Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use vim editing keys in my shell (zsh).

With bindkey -v i get VI keys, but i want visual and more advanced key shortcuts (like change inner word (ciw), which i use all the time)

btw, is superuser the right forum for this question?

share|improve this question
Yes, Super User is a good place for this question. – Troggy Feb 4 '10 at 13:43
// , Have you ever ended up getting the ~ key when you press Delete? – Nathan Basanese Nov 8 '15 at 4:47
up vote 3 down vote accepted

As for the bash part in the title: You can put bash into vi mode by calling set -o vi (e.g. put that into your .bashrc). To bind functions to specific keys you have to use bind in bash. See help bind to list the available functions and examples of how to call it.

"Change inner word" is not in vi, but vim, so it is not available.

share|improve this answer
set -o vi doesn't work for me. I'm on CentOS 5.x. – Christopher Bottoms Oct 12 '10 at 16:16

I know my answer is really late but if people are still searching for the same thing

For commands like ciw and commands from surround.vim use this zsh plugin

For visual mode use this zsh plugin

Source them in your .zshrc to enable them

share|improve this answer

In bash pressing v (in command mode) opens vi(m) with the current content of the command line. You can now edit the line, using every feature of vi(m), and after quitting the line will be automatically executed.

Take a look at this article for a good introduction and a cheat sheet of vi command line editing mode.

share|improve this answer

I don't see that particular one, but these functions are documented in man zshrle and some of them may be unbound. Search that file for the string "vi-" to find the available vi functions.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.