set -o vi FTW

The Bash command line can be edited using the cursor keys but for the real power user you need to enable Vi mode:

$ set -o vi

Or add it to one of your Bash startup files.

Now, instead of the slow interactive editing you’ll get the command and insert mode of Vi! Users of Vi or Vim will feel right at home. You start in insert mode by default so it feels the same as before. You can type new text, move left and right with the cursor keys and delete text but press ESC and you can do all the things Vi command mode allows you to do.

Check out this extensive cheat sheet with examples or jump directly to the ascii version here!

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close