3 ms·
GNU readline is always surprising to me, being a Vi guy I almost always `C-x C-e` to edit my command with, you guessed it right: {,n}vi{,m}. But it seems that
by RMPR 7y ago
GNU readline is always surprising to me, being a Vi guy I almost always `C-x C-e` to edit my command with, you guessed it right: {,n}vi{,m}. But it seems that just taking the time to learn readline will be a very big boost in productivity.
- tasuki 7y agoI'm happy enough with `set editing-mode vi` in ~/.inputrc (for bash) and `plugins=(vi-mode)` in ~/.zshrc (for zsh).
- the_pwner224 7y agoYou can add 'set -o vi' to your bashrc to enable a sort of vim emulation. Pressing Esc will take you to command mode, where you can use commands like b, w, e, 5x, i. Ctrl-w and ctrl-y still work as described here. More importantly, if fixes the ctrl-w behaviour. By default c-w will delete up to the previous space. With set -o vi however, it deletes the same amount that vi considers a word to be. So if you're doing cd /a/long/dir and want to change it to /a/long/other/dir, pressing ctrl-w will only delete the last 'dir' instead of deleting the entire path. The default behaviour is highly aggravating.