razputnik: (Default)
razputnik ([personal profile] razputnik) wrote in [community profile] command_liners2010-11-01 01:43 pm
Entry tags:

Bash vi mode

I noticed a few people making posts about editing their shell history with vi - so I thought I'd contribute this little trick that someone may or may not have mentioned already:

If you add "set -o vi" to the end of your .bashrc, it changes your command line editing mode to vi keybindings, meaning you can use hjkl to navigate through your history and edit lines using vi oldies but goldies like cw and c$. It's a bit of a pain to get used to at first, but it's good if you're the type who keeps typing cw when you want to change an argument and then get annoyed when it just inserts that as text.

:wq