Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am a long time vi(m) user and recently made the switch to using vi key binding in bash. I can already tell that this will be an improvement, but I would like to customize a few things to really become proficient.

  1. I currently use the following mapping and it is totally entrenched: map ii <esc>. Can I do the same on the command line? It may seem trivial, but I am so used to just tapping i twice that reaching all the way up to the escape key is painful.
  2. I would LOVE to find a way to indicate what mode I am in: insert or command. This could take the from of changing the cursor type/color, putting a note in the prompt, etc.

I have looked through the man pages for bash and looked at creating an .inputrc file, but so far have come up with nothing that would work. I see that you can map keys, but can you do it for two keys hit in rapid succession, like I do?

I have seen solutions out there that say they work for zsh. I am not interested in switching to zsh. If this is not possible in bash, I can live with it.

share|improve this question
First question addressed here, second addressed here, but it's a zsh answer. I know that zsh/bash prompt handling is different. –  pb2q Aug 19 '12 at 18:27
Also see this question –  pb2q Aug 19 '12 at 19:25
Cool... Thanks, pb2q, that first link is exactly what I needed. Unfortunately, for now, it seems my second request above is just not possible yet. –  JmZ Aug 19 '12 at 21:56
add comment

migrated from stackoverflow.com Aug 19 '12 at 22:08

This question came from our site for professional and enthusiast programmers.

Your Answer


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

Browse other questions tagged or ask your own question.