Closed alexzanderr closed 1 year ago
I've found a scroll_offset = 6
inside joshuto.toml
.
Does this have a related context with the scrolling I'm talking about.
Hi!
Nope. The scroll_offset
defines how many entries in the file list are kept at the border after/before the cursor when scrolling. Move the cursor down a long list of files and and you will see that Joshuto starts scrolling the file list when your cursor is 6 entries away from the bottom of the list.
See commit msg.
I'm not completely sure but I think that the feature of scrolling the preview is not available in Joshuto right now.
oh. okey. thanks for response
Hey, this feature already exists with
preview_cursor_move_up
preview_cursor_move_down
:)
You can learn more about it in the docs here: https://github.com/kamiyaa/joshuto/blob/main/docs/configuration/keymap.toml.md
Ok.
I've followed the instructions in the keymap.toml.md
.
This is my attempt:
[default_view]
keymap = [
{ keys = [ "ctrl+arrow_up"], command = "preview_cursor_move_up" },
{ keys = [ "ctrl+arrow_down"], command = "preview_cursor_move_down" },
# ....
]
When running the program doesnt work and says after exit:
❱ cargo run --all-features
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running `target/debug/joshuto`
Error: Keybindings ambiguous for preview_cursor_move_down
Error: Keybindings ambiguous for preview_cursor_move_down
Error: Keybindings ambiguous for preview_cursor_move_down
and also the command :preview_cursor_move_down
its working, but my keymap seems that is not registered properly
{ keys = [ "T" ], command = "preview_cursor_move_down" },
this works.
so the keymap its not registered
The ambiguous error means you have multiple commands mapped to ctrl+arrow_down
and joshuto doesn't know what to do
ok here's the entire keymap toml
# ~/.config/joshuto/keymap.toml
[default_view]
keymap = [
{ keys = [ "ctrl+arrow_up"], command = "preview_cursor_move_up" },
{ keys = [ "ctrl+arrow_down"], command = "preview_cursor_move_down" },
{ keys = [ "T" ], command = "new_tab" },
{ keys = [ "ctrl+t" ], command = "new_tab" },
{ keys = [ "W" ], command = "close_tab" },
{ keys = [ "ctrl+w" ], command = "close_tab" },
{ keys = [ "q" ], command = "close_tab" },
{ keys = [ "Q" ], command = "quit --output-current-directory" },
{ keys = [ "R" ], command = "reload_dirlist" },
{ keys = [ "z", "h" ], command = "toggle_hidden" },
{ keys = [ "ctrl+h" ], command = "toggle_hidden" },
{ keys = [ "\t" ], command = "tab_switch 1" },
{ keys = [ "backtab" ], command = "tab_switch -1" },
{ keys = [ "alt+1" ], command = "tab_switch_index 1" },
{ keys = [ "alt+2" ], command = "tab_switch_index 2" },
{ keys = [ "alt+3" ], command = "tab_switch_index 3" },
{ keys = [ "alt+4" ], command = "tab_switch_index 4" },
{ keys = [ "alt+5" ], command = "tab_switch_index 5" },
# arrow keys
{ keys = [ "arrow_up" ], command = "cursor_move_up" },
{ keys = [ "arrow_down" ], command = "cursor_move_down" },
{ keys = [ "arrow_left" ], command = "cd .." },
{ keys = [ "arrow_right" ], command = "open" },
{ keys = [ "\n" ], command = "open" },
{ keys = [ "home" ], command = "cursor_move_home" },
{ keys = [ "end" ], command = "cursor_move_end" },
{ keys = [ "page_up" ], command = "cursor_move_page_up" },
{ keys = [ "page_down" ], command = "cursor_move_page_down" },
{ keys = [ "ctrl+u" ], command = "cursor_move_page_up 0.5" },
{ keys = [ "ctrl+d" ], command = "cursor_move_page_down 0.5" },
# vim-like keybindings
{ keys = [ "j" ], command = "cursor_move_down" },
{ keys = [ "k" ], command = "cursor_move_up" },
{ keys = [ "h" ], command = "cd .." },
{ keys = [ "l" ], command = "open" },
{ keys = [ "g", "g" ], command = "cursor_move_home" },
{ keys = [ "G" ], command = "cursor_move_end" },
{ keys = [ "r" ], command = "open_with" },
{ keys = [ "H" ], command = "cursor_move_page_home" },
{ keys = [ "L" ], command = "cursor_move_page_middle" },
{ keys = [ "M" ], command = "cursor_move_page_end" },
{ keys = [ "[" ], command = "parent_cursor_move_up" },
{ keys = [ "]" ], command = "parent_cursor_move_down" },
{ keys = [ "c", "d" ], command = ":cd " },
{ keys = [ "d", "d" ], command = "cut_files" },
{ keys = [ "y", "y" ], command = "copy_files" },
{ keys = [ "p", "p" ], command = "paste_files" },
{ keys = [ "p", "o" ], command = "paste_files --overwrite=true" },
{ keys = [ "y", "n" ], command = "copy_filename" },
{ keys = [ "y", "." ], command = "copy_filename_without_extension" },
{ keys = [ "y", "p" ], command = "copy_filepath" },
{ keys = [ "y", "d" ], command = "copy_dirpath" },
{ keys = [ "delete" ], command = "delete_files" },
{ keys = [ "d", "D" ], command = "delete_files" },
{ keys = [ "a" ], command = "rename_append" },
{ keys = [ "A" ], command = "rename_prepend" },
{ keys = [ "f", "t" ], command = ":touch " },
{ keys = [ " " ], command = "select --toggle=true" },
{ keys = [ "t" ], command = "select --all=true --toggle=true" },
{ keys = [ "w" ], command = "show_tasks --exit-key=w" },
{ keys = [ "b", "b" ], command = "bulk_rename" },
{ keys = [ "=" ], command = "set_mode" },
{ keys = [ ":" ], command = ":" },
{ keys = [ ";" ], command = ":" },
{ keys = [ "'" ], command = ":shell " },
{ keys = [ "m", "k" ], command = ":mkdir " },
{ keys = [ "f2" ], command = ":rename " },
{ keys = [ "/" ], command = ":search " },
{ keys = [ "|" ], command = ":search_inc " },
{ keys = [ "\\" ], command = ":search_glob " },
{ keys = [ "S" ], command = "search_fzf" },
{ keys = [ "C" ], command = "subdir_fzf" },
{ keys = [ "n" ], command = "search_next" },
{ keys = [ "N" ], command = "search_prev" },
{ keys = [ "s", "r" ], command = "sort reverse" },
{ keys = [ "s", "l" ], command = "sort lexical" },
{ keys = [ "s", "m" ], command = "sort mtime" },
{ keys = [ "s", "n" ], command = "sort natural" },
{ keys = [ "s", "s" ], command = "sort size" },
{ keys = [ "s", "e" ], command = "sort ext" },
{ keys = [ "g", "r" ], command = "cd /" },
{ keys = [ "g", "c" ], command = "cd ~/.config" },
{ keys = [ "g", "d" ], command = "cd ~/Downloads" },
{ keys = [ "g", "e" ], command = "cd /etc" },
{ keys = [ "g", "h" ], command = "cd ~/" },
{ keys = [ "?" ], command = "help" }
]
[task_view]
keymap = [
# arrow keys
{ keys = [ "arrow_up" ], command = "cursor_move_up" },
{ keys = [ "arrow_down" ], command = "cursor_move_down" },
{ keys = [ "home" ], command = "cursor_move_home" },
{ keys = [ "end" ], command = "cursor_move_end" },
# vim-like keybindings
{ keys = [ "j" ], command = "cursor_move_down" },
{ keys = [ "k" ], command = "cursor_move_up" },
{ keys = [ "g", "g" ], command = "cursor_move_home" },
{ keys = [ "G" ], command = "cursor_move_end" },
{ keys = [ "w" ], command = "show_tasks" },
{ keys = [ "escape" ], command = "show_tasks" },
]
[help_view]
keymap = [
# arrow keys
{ keys = [ "arrow_up" ], command = "cursor_move_up" },
{ keys = [ "arrow_down" ], command = "cursor_move_down" },
{ keys = [ "home" ], command = "cursor_move_home" },
{ keys = [ "end" ], command = "cursor_move_end" },
# vim-like keybindings
{ keys = [ "j" ], command = "cursor_move_down" },
{ keys = [ "k" ], command = "cursor_move_up" },
{ keys = [ "g", "g" ], command = "cursor_move_home" },
{ keys = [ "G" ], command = "cursor_move_end" },
{ keys = [ "w" ], command = "show_tasks" },
{ keys = [ "escape" ], command = "show_tasks" },
]
there is only one
command with the keymap: ctrl+arrow_down
file is located at: ~/.config/joshuto/keymap.toml
the bug is the same with:
$HOME/.cargo/bin/joshuto
cargo run
in my forkstill getting the
❱ cargo run --all-features
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running `target/debug/joshuto`
Error: Keybindings ambiguous for preview_cursor_move_down
So it looks like termion
(the library that joshuto
uses for input), it only supports Ctrl/Alt + a character https://docs.rs/termion/latest/termion/event/enum.Key.html
So Ctrl+arrow_up/arrow_down is currently not supported
https://gitlab.redox-os.org/redox-os/termion/-/issues/194
https://gitlab.redox-os.org/redox-os/termion/-/merge_requests/175
Well... I would like to propose a migration for the terminal backend to crossterm
.
I've used crossterm
before and the reason for migrating to crossterm was exactly
the same as this one. Termion
lacks Ctrl+non-ascii
.
I can make a PR and also create a new issue for this situation. You decide.
Oh, just saw that there is a PR waiting for that feature in termion. Well ... we can make separate features and let the users decide which backend to use.
# ...
default = ["termion-backend"]
termion-backend = []
crossterm-backend = []
# ...
temporarily, i can use this
{ keys = [ "j"], command = "preview_cursor_move_up" },
{ keys = [ "k"], command = "preview_cursor_move_down" },
thanks for help.
Hello.
Love your project. Its blazingly fast.
Is there a way to scroll down/up the preview ?![image](https://user-images.githubusercontent.com/54772464/180601730-285e1402-5c68-46c8-965d-1c2ba738b0f9.png)
For example I want to:
ctrl+down
ctrl+up
In ranger, you could do that with:
alt+j
-> scroll downalt+k
-> scroll upIf there is no way to do that right now, I would like to make a feature request.
Thanks.