diff options
author | DLFW <daniel@llin.info> | 2022-08-30 19:46:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 13:46:22 -0400 |
commit | 826e24eaf4a10921bdd087079c4d7330896b79c2 (patch) | |
tree | ecce44e4243f7b58d110e071759a5ec32c6be2fb /config | |
parent | edf620b4aceaaadffedd14d85d120d485a6ad8f3 (diff) |
Add "Visual-Mode" (#192)
* Add "Visual-Mode"
This adds a "visual-mode" file selection feature where a range-selection follows the file-cursor.
Description of usage is added to the docs.
Also, the "normal" and the new "visual-mode-selection" are now preserved
when a `DirList` is reloaded.
Wrap-up of changes:
* Add command `toggle_visual`, mapped to `V`
* Add command `escape`, mapped to `ESCAPE`
* Add style `[visual_mode_selection]` for file entries which are
"temporarily" selected by visual-mode
* For `JoshutoDirEntry`, the attribute `selected` has been renamed to
`permanent_selected`, and a second selection-attribute
`visual_mode_selected` has been added. "Setters" and "getters" have
been adapted/added accordingly. The former "getter" for the `selecetd`
attribute still exists and returns `True` for an entry which is
"permanant selected" _or_ "visual-mode selected". So any higher logic
which acts on selected files does not need to care about "how" and
entry is selected.
* Each `JoshutoDirList` has an optional index of the file where
visual-mode has been entered and re-calculates the "visual-mode
selecetd" status for each entry any time the cursor-index changes.
* The footer has been extended so it shows a "VIS" marker when the user
is in visual-mode.
This implementation of visual-mode is a bit different from the ranger
one, where the visual-selection is turned into a "normal selection" when
a command (like `copy-files`) is issued. This implementation keeps
both selections separate until the user toggles back to "normal mode".
Only then the visual-selection is taken over to the "normal selection".
The user also can withdraw the visual-selection with `escape`.
The `escape` command may be used also for other "reset"-actions in the
future.
* fix syntax for Rust stable
* cargo clippy
Diffstat (limited to 'config')
-rw-r--r-- | config/keymap.toml | 2 | ||||
-rw-r--r-- | config/theme.toml | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/config/keymap.toml b/config/keymap.toml index 0e546cb..3fb469a 100644 --- a/config/keymap.toml +++ b/config/keymap.toml @@ -1,6 +1,7 @@ [default_view] keymap = [ + { keys = [ "escape" ], command = "escape" }, { keys = [ "T" ], command = "new_tab" }, { keys = [ "ctrl+t" ], command = "new_tab" }, { keys = [ "W" ], command = "close_tab" }, @@ -71,6 +72,7 @@ keymap = [ { keys = [ " " ], command = "select --toggle=true" }, { keys = [ "t" ], command = "select --all=true --toggle=true" }, + { keys = [ "V" ], command = "toggle_visual"}, { keys = [ "w" ], command = "show_tasks --exit-key=w" }, { keys = [ "b", "b" ], command = "bulk_rename" }, diff --git a/config/theme.toml b/config/theme.toml index 049fe41..341c543 100644 --- a/config/theme.toml +++ b/config/theme.toml @@ -1,6 +1,11 @@ [selection] fg = "light_yellow" bold = true + +[visual_mode_selection] +fg = "light_red" +bold = true + [selection.prefix] prefix = " " size = 2 |