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 use nnoremap ; : to go to command mode. Is there oposite shortcut that i can add to my .vimrc so that i won't press ESC every time to go back to normal mode?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Aborting command-line mode shouldn't be so frequent, why do you worry about having to press Esc?!

Some people remap Caps Lock to either Esc or Ctrl (outside of Vim), this also helps with leaving insert mode. Did you know that you can also use Ctrl-C to abort the command-line? Alternatively, you can define a mapping, e.g. ;; to abort the command-line:

:cnoremap ;; <C-c>
share|improve this answer
add comment

Choose some easy-to-type key sequence that you aren't likely to use in any text and map it to <Esc>. The sequence qq is not found in English, for example, so you could map it like this:

inoremap qq <Esc>

If you ever have a need to enter that sequence into some file, just precede it with Ctrl-V.

share|improve this answer
    
He wants to leave the command line, not insert mode, but the mapping is almost identical: :cnoremap. –  Ingo Karkat Dec 22 '12 at 2:01
    
@Ingo Karkat: OK, thanks. I never leave command mode except when finishing the command, so despite his words, I assumed he meant to leave insert mode. –  garyjohn Dec 22 '12 at 5:09
add comment

Your Answer

 
discard

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.