Closed vancleve closed 3 years ago
Rather than creating a new issue I'll hijack this one to to ask for specific keybindings as you suggested on Discourse.
"Less" has a ton of redundant keybindings, so it may not make sense to support all of them. For what it's worth, here are the ones I find most useful:
g
/G
for begin/end of documentspace
for one screen forwardj
/k
for vertical scrollingh
/l
for horizontal scrollingq
for quitting the pager/
and n
/N
for searching and going to next/previous match<
/>
for begin/end of documentf
/b
for one screen forward/backwardCtrl+V
/Alt+V
for one screen forward/backward (also works in Emacs)Ctrl+F
/Ctrl+B
for one screen forward/backward (also works in "vi")30<key>
as equivalent to 30 times <key>
(e.g. 5j
to scroll 5 lines) and in particular:30g
to go to line 30Thanks @vancleve and @knuesel !
I will try to implement it. If we have some clash with existing key bindings, I will let you know so that we can discuss about it.
Hi @knuesel
I implemented '<' / '>', and 'b' to go back (making a nice pair with space
). However, f
is already used to freeze columns and rows.
I prefer to avoid those key bindings like CTRL+V
/ALT+V
and CTRL+F
/CTRL+B
. It just does not make sense for me.
Finally, those key bindings that takes a number will make the processing a lot more complicated. Right now, it is a 1 to 1 function (key binding => action). If I add numbers, then I need a state machine to take care of the command. I think it is an unnecessary complication for a pager.
Feel free to reopen if you disagree.
Its right above
SPACE
so its easy to press instead of reaching for pageuphttps://man7.org/linux/man-pages/man1/less.1.html