Closed Galicarnax closed 3 years ago
Thanks for the PR and big work that you've done, it's really good staff 👍
As bash and emacs user, I would appreciate to have ctrl+b, ctrl+f for backward/forward one char movement. It would be good to have consistency and to be user friendly for those who have muscle memory of this key binding.
For the beginning of line I would suggest to use ctrl+a (also this is keybinding in shell). Or if you prefer we could add vim keybindings as well.
My personal feature request is alt+delete for backward word deletion, do you think it will be complicated to add?
Also, unfortunately for me some keybinding not working, though it's okay if they working for you.
Perhapse, optimal solution would be to have a single param in config
, something like INPUT_KEYS_STYLE
, which might be set to, say, EMACS
or VIM
. The only problem here is that, to my knowledge, there is no universal way with curses
to have certain key bindings (involving ctrl
and alt
modifiers) to behave identically across all terminal emulators. Well, having it working at least on some terminals is better than not working on all terminals, I think... So I'll try to make it.
Basic text manipulation when using
StatusView
' input. Key bindings similar to those in Vim's command line:arrows left/right
: move by charsctrl+left/right
: move by wordsctrl+h
,backspace
: delete previous chardelete
: delete char under cursor (if at the end of line - delete previous char)ctrl+w
: delete previous wordctrl+delete
: delete word after cursorctrl+u
: delete from cursor to the beginning of linehome
,ctrl+b
: go to the beginning of lineend
,ctrl+e
: go the end of lineNavigation/editing attempts to be wide-charactare aware. Some key bindings (e.g., ctrl+arrows) might not work in some terminal emulators (
curses
returns different terminal-dependent values for keys). Current version tested in Linux only, withkitty
,terminator
,alacritty
.