Open kwshi opened 6 years ago
I'll second this. I have the following in my startup script to get the best of both worlds - fine-grained by default with opt-in to coarse-grained using the shifted variants.
{
var bind~ = {|k f| set edit:insert:binding[$k] = $f }
bind Alt-b $edit:move-dot-left-small-word~
bind Alt-B $edit:move-dot-left-word~
bind Alt-f $edit:move-dot-right-small-word~
bind Alt-F $edit:move-dot-right-word~
bind Alt-d $edit:kill-small-word-right~
bind Alt-D $edit:kill-word-right~
}
Not a bug, but a suggestion.
Currently,
Alt+f
andAlt+b
keybindings correspond toedit:move-dot-left-word
andedit:move-dot-right-word
, which respectively move the cursor left and right by a WORD, which is a contiguous sequence of non-whitespace characters. Instead, I propose mapping those keys toedit:move-dot-left-small-word
andedit:move-dot-right-small-word
by default, which move the cursor relative to a word, which is a contiguous sequence of alphanumeric characters, or a contiguous sequence of non-alphanumeric characters, separated by whitespace.This would be a desirable default because it would essentially match the default behavior of readline bindings in other popular shells (i.e.
bash
andzsh
), and also approximately match word-movement behavior in vim and emacs.Furthermore, in most situations I have come by, I have found it generally preferable to edit and move by small-word rather than by WORD. As an example, if I want to manipulate a long file path, or a long URL, it would be more convenient to be able to use
Alt-b
to hop my cursor to the middle of the path/URL, where current behavior only allows me to move to either the beginning or the very end of the string, from which I would need to navigate by-character (i.e. arrow keys, or equivalent) to the middle of the string.