Treat underscores as word boundaries in terminal using vim mode
+3
−0
Question
How do you specify underscores as Vim word boundaries when using vim mode in either bash or zsh?
MWE
w on this_word should place the cursor on the underscore. A second w should place the cursor on the 'w' of "word".
1 answer
+1
−0
You can't, without patching readline. What counts as a word character is hard-coded in the readline library, as of this writing.
See:
- https://git.savannah.gnu.org/cgit/readline.git/tree/vi_mode.c#n620
- https://git.savannah.gnu.org/cgit/readline.git/tree/chardefs.h#n115

0 comment threads