Commit Graph
133 Commits
Author SHA1 Message Date
David Pedersen f20d0e5fb4 Make duplicated file format configurable (#1315)
* Make duplicated file format configurable

* Add %b and %f options to dupfilefmt
2023-07-04 12:29:24 +03:00
raslop b1a851953b Flexible filename truncation (#1029)
* allow flexible truncation of filenames

As of now, lf truncates always at the end. So for long filenames one can
not see the end (especially not the file ending, like .jpeg or .pdf).

[MidnightCommander](https://github.com/MidnightCommander/mc/) truncates
too long filenames in the middle, so it's possible to see the beginning
and the end of the too long filename.

This commit allows to specify a flexible point for the truncation in
percent of the available space.

* The default value of 100 for the new `truncatepct` option means no
change in lf behaviour.

* More adhering to naming convention.

* Improve error message for invalid `truncatepct` values.

* Remove redundant test cases.

* FIXUP Add dummy empty line to make `go fmt` happy.

* Avoid explicit "cast" to rune array.

* fix(doc.go): remove line with single dot

This was there to avoid that `go fmt` touches the next item with `waitmsg`.
However, removing the spaces before the example list items has the same
effect.
2023-07-03 12:48:51 +03:00
Joe Lim 2ab4b14e88 Add statfmt option (#1288)
* Add `fileinfofmt` option

* echof is now unused

* Use different default for Windows

* Add new line to docs

* Indent placeholders description in documentation

* Change option name to `statfmt`

* Use plain text format for documentation
2023-06-09 14:45:35 +03:00
Gokcehan 0ac1491bfb cleanup
cc #1026
2023-05-21 19:41:41 +03:00
raslop fdb320d30c preserve mtime when copying files (#1026)
* make it possible to preserve mtime and atime when copying files

Preserving other attributes like ownership, ctime or btime of a file is
desired but currently not possible to implement in a portable way with go.

Fixes #869
Relates to #779

* FIXUP use cp-compatible default for not-preserving mode
2023-05-21 19:41:01 +03:00
Joe Lim 3b942a8a39 Support custom colors for drawbox characters (#1251) 2023-05-20 17:53:05 +03:00
Joe Lim 88b3c999af Fix count when parsing bottom command (#1240)
* Fix count when parsing `bottom` command

* Revert "Fix count when parsing `bottom` command"

This reverts commit a0b6bb5a13.

* Alternate implementation

* Add comment
2023-05-13 16:58:21 +03:00
Joe Lim 8f630e0cab Separate filter from selections in the ui ruler (#1223) 2023-05-13 14:19:50 +03:00
rrveexandrr eb84772032 Customizable statusline, df (#1168)
* opts statusline, df

* renamed infostat -> ruler; removed os_lin, os_bsd

* removed vscode

---------

Co-authored-by: rr <rr@arveex.eu>
2023-04-09 14:50:34 +03:00
Joe Lim b5c83dbf7a Add support for moving to a specific line (#1196)
* Add support for moving to a specific line

* Update documentation
2023-04-08 23:40:16 +03:00
Joe Lim 11caeddb35 Support custom line number colors (#1177)
* Support custom line number colors

* Move eval case
2023-04-01 16:05:44 +03:00
David Pedersen cae576bb1d Navigate cmd history with up/down (#1112) 2023-02-25 20:41:32 +03:00
Ilya Grigoriev 6afefa5d09 Option to change look of cursors in parent dirs, rename an option. (#1106)
* Add `cursorparentfmt` option for cursors in parent dirs

The option defaults to the same value as `cursorfmt`, so the default look of `lf` is unchanged. However, I find it useful to make it different, since I seem to have so much trouble figuring out which of my cursors is the active one. :)

For example, here's what it looks like if one has `set cursorparentfmt "\033[7;90m"` in their `lfrc`:

https://user-images.githubusercontent.com/4123047/218299130-09ac411f-307a-489e-a4f0-4691710f8549.png

* Remove `cursorfmt` option to `cursoractivefmt`

This seems appropriate after introducing `cursorparentfmt`
2023-02-25 20:38:41 +03:00
Ilya Grigoriev 530ab2c40a Allow separate styles for cursor in normal and preview panes, simplify tagfmt and errorfmt (#1086)
* Allow separate styles for cursor in normal and preview panes

This defines new `cursorfmt` and `crusorpreviewfmt` options to style cursor in normal/preview panes. This allows using a different style for the normal and preview cursor. The documentation includes several possible values these options can be set to.

The default behavior is an underline, same as in
https://github.com/gokcehan/lf/pull/1072, since it should not cause severe
problems and be visible on all terminals. It can now be easily changed, as explained in the docs. I also added an example to `etc/lfrc.example`.

See linked issues and PRs for the more context.

Fixes https://github.com/gokcehan/lf/issues/1038

Follows up on:

https://github.com/gokcehan/lf/pull/1072
https://github.com/gokcehan/lf/pull/924
https://github.com/gokcehan/lf/commit/b47cf6d5a5

* Simplify configuration of several formatting options

This simplifies the configuration of `cursorfmt`, `cursorpreviewfmt`, `tagfmt`,
and `errorfmt` options.

In almost all usecases, the value of these options had to end with `%s\033[0m`
to print the contents of filename/tag/error and reset the terminal style. Now,
if `%s` is not part of the option's value, `%s\033[0m` is appended
automatically. This simplifies configuration.

I retained the same behavior as before when `%s` is part of the string for
backwards compatibility. I think it should be considered deprecated, but it
also causes no harm.
2023-02-11 20:11:07 +03:00
Ilya Grigoriev 2fe5e4d54e Bind Ctrl+MouseWheel to scroll up/down (#1051)
On my system, Shift+Mouse is captured by the terminal and
Alt+Mouse only works for one of the alt keys. Hence I picked
Ctrl.

This also allows binding of Ctrl+MouseButtons (but doesn't set
any such bindings). 

As a minor bonus, that should allow using Ctrl+Click to select
`lf`'s terminal without moving the cursor no matter where you
click.  On tmux, this doesn't work out of the box and requires
a change to `tmux.conf` along the following lines:

     bind-key -T root  C-MouseDown1Pane  select-pane -t = \; send-keys -M

You can omit the `send-keys -M` if you never want to pass
`Ctrl+Click` to any of your terminal apps. (Then it will work
without this PR).
2023-02-11 19:58:44 +03:00
Paul Ouellette a94015d221 Add mouse support for selecting and opening files (#963)
* Add mouse support for selecting and opening files

Left click to select, right click to open, similar to ranger.
Closes #919.

* Add default mouse wheel mappings

* Update tcell to d3cbfcf

Commit d3cbfcf fixes a bug where mouse wheel events were misdelivered as
button events.
2022-10-19 18:57:44 +03:00
Christian Zangl a2fed6d16e add user defined options (#865) 2022-10-15 15:50:21 +03:00
Christian Zangl 21a32a7603 Add a selection mode that limits the selection to the current directory. (#849) 2022-10-15 15:43:15 +03:00
Salle Helevä 479ed924f7 Implement directory previews (#842)
* Directory previews, initial implementation.

* Continue previous; add goroutine for directory previews.

* Enable dirpreviews as an option, run gofmt and fix referencing nil.

* Only use dirpreviews if previewer script exists.

* Remove redundant function call to `dirPreview`.

* Remove unnecessary dev-comments.

* Send to `dirPreviewChan` also on modifying folder contents.
2022-10-15 15:42:08 +03:00
segf00lt da2d8a2979 added history options (#866)
* added history options

* sorry forgot to update docs
2022-07-10 15:32:34 +03:00
Gokcehan 7feb42db34 rename move commands to high/middle/low
cc #824
2022-05-08 14:03:32 +03:00
Christian Zangl 01fe12b2ce Add VIMs hi/mid/lo-screen commands (#824)
* add hi/mid/lo-screen commands and default keybindings

* doc
2022-05-08 13:58:56 +03:00
Gokcehan 4db1a63b75 rename scrollup/down to scroll-up/down
cc #764
2022-03-30 12:58:38 +03:00
Gokcehan afa90fe647 use multiple selections for tag command
cc #791
2022-03-28 18:02:17 +03:00
Gokcehan 9144df10ad stay at same position with tag-toggle
cc #791
2022-03-28 15:55:57 +03:00
Santos 5a5628d667 Add tags (#791)
* initial tags implementation

* add tag to complete.go

* add gTagsPath to os_windows.go

* change behaviour to match other commands

* add tag-toggle to complete.go

* add tag and tag-toggle to docs

* address feedback about tags
2022-03-28 15:43:05 +03:00
sbinnee b4637f91aa add scrollup scrolldown builtin cmd (#764)
* add scrollup scrolldown builtin cmd

Scrollup/down move window pane without moving current cursor position.
Default keybinding would be <c-y> for scrollup and <c-e> for scrolldown
just like in vim.

* limit scrolldown when reached bottom

scrolodown will not allow empty space

Fix typo
2022-02-27 12:37:27 +03:00
Christian Zangl 375133e483 add "jump-next" and "jump-prev" (#755) 2022-02-13 12:02:18 +03:00
Gokcehan b5de2cd666 cleanup
cc #751
2022-02-12 12:54:11 +03:00
Christian ZanglandKrzysztof Maicher b08ab8dfb7 Continue PR: configure time format in the info column (#751)
* Allow to configure time format in the info column

* Update infotimefmt PR from Krzysztof Maicher

Add format length, rename options

Co-authored-by: Krzysztof Maicher <krzysztof.maicher@gmail.com>
2022-02-12 12:23:22 +03:00
Christian Zangl 958857f4c4 Add Temporary Marks (#744)
* add temporary marks

* change option format & documentation
2022-01-31 02:28:06 +03:00
Gokcehan 930364ce78 Revert "dirtyfiles: files that don't require cleaning before previewing them (#729)"
This reverts commit 673dad9f07.
2022-01-22 16:57:28 +03:00
Lucas Mior 673dad9f07 dirtyfiles: files that don't require cleaning before previewing them (#729)
* dirtyfiles

* wrong default on man page

* respect alphabetic order for options

* clean on shell commands

* formating if
2021-12-25 20:49:30 +03:00
SPFab ff0933ca03 Added filter command (#667)
* added first version of interactive filter

* small fix when loading new file

* don't reset filter when directory is reloaded automatically

* reapply filter when options for searching change

* current filter or arguments now prefilled in the prompt

* empty filter can now be supplied

* added new setfilter command for use in scripts

* added incfilter option

* added very basic documentation

* added filter indication in statusbar

* added option to display filter to prompt
2021-08-21 16:40:24 +03:00
Yegor Bychin ee5b3f4813 add an option to disable directory cache (#673)
* add an option to disable directory cache

* change option name to `dircache`

* change 4 whitespaces to tab
2021-08-01 17:00:10 +03:00
Matthew Tooheyandmtoohey31 75eba115d2 implement dironly option (#669)
Co-authored-by: mtoohey31 <mtoohey31@users.noreply.github.com>
2021-07-31 16:10:25 +03:00
Gokcehan 06a30eda19 add 'autoquit' option to auto quit server on quit
cc #177
2021-05-19 21:55:19 +03:00
gotroyb127 0cfd34f30d add 'waitmsg' option to configure the message after shell-wait commands (#604) 2021-04-06 18:57:23 +03:00
Gokcehan ca0068514a add 'shellflag' option to customize shell flag
cc #597
2021-04-04 18:23:14 +03:00
Gokcehan 13d19d84f9 add 'mouse' option to enable/disable mouse events
cc #268 #570
2021-01-29 19:36:27 +03:00
Gokcehan 2e4ed8f867 fix default promptfmt to use %d instead of %w
cc #545
2021-01-11 00:40:14 +03:00
neeshy 82f03102a5 Add ability to use image previewers (#531)
* Return early on error in nav.preview

* nav.checkReg now returns a boolean instead of calling nav.preview

* Pass width, height, x, and y parameters to preview script

* Check previewer for exit code

If non-zero the preview will be assumed to have side-effects.

* Add the cleaner option

This is called upon selection changes if the previous preview was
volatile. To this end, volatilePreview was added to the nav struct
2020-12-24 16:13:20 +03:00
Gokcehan f68406b93c enable 'ignoredia' by default
Related #320
2020-11-06 16:03:02 +03:00
Gokcehan 228a20ffd1 rename bs to backspace 2020-10-10 17:34:29 +03:00
Provessor 24f01f4988 Replace termbox-go with tcell (#439)
Fix colour construction issue

This also has a test to mitigate it in the future

Remove `colormode` option

The original issue it was trying to solve is no longer present with
tcell (it being a holdover from `color256` on termbox) so it is not
needed.

retire gitter channel in favor of irc/matrix

Export options as environment variables (#448)

* Export options as environment variables

Any options from gOpts are available via lf_OPTION environment
variables. For now it works only on booleans, integers and strings (no
array support)

* Do not export some of the options

* Add support for arrays and fix numbers

* Fix comments

* Replace 1 and 0 with true and false

* Export hidden,reverse,dirfirst and sortby options

* Fix comments

* Little fix

* Simplify boolean conversion

log readlink errors instead of fail

Related #447 and #374
2020-09-01 15:42:44 +03:00
Gokcehan f8daa60b31 expand '%w' in 'promptfmt' with a trailing slash
Related #421
2020-07-20 00:19:42 +03:00
Alexey Yerin d0cd181eb6 Ability to customize filename truncating (#417)
* Add truncatechar option

* Add ability to set truncatechar via `set` command

* Add completion for truncatechar option

* Actually use truncatechar option when truncating

* Add truncatechar option to docs
2020-07-18 03:08:25 +03:00
gotroyb127 4d3e1cfd6e added a count field to listExpr and toggle now ignores count (#394) 2020-07-03 18:29:55 +03:00
Ivan Podmazov cbb559346d fix toggle behaviour (#352) (#386) 2020-06-17 06:17:30 +03:00
Gokcehan 0e3910652a cleanup 2020-06-11 04:11:40 +03:00