Hacker News new | ask | show | jobs
by sixtofour 5392 days ago
And, if you've set -o vi in bash (etc?), when you're editing a command line and need more than just the limited set of vi commands that make sense on a command line, do this:

esc v

esc gets you out of input mode, and v takes the current command line that you're editing and opens a full vi/vim session initialized with the command line. After you're done editing it, :wq quits vi and executes the command. If you change your mind, delete everything in the buffer and then :wq

This is handy if you're editing a biggish command, particularly one from recent history like a loop or anything with a block.

1 comments

`set -o vi` is a POSIX shell feature.