3 ms·
You 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, 5
by the_pwner224 7y ago
You 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.