Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 cannot understand why having this line:

nmap <C-[> :tabprevious<cr>

... causes vim to open up immediately in "c" (change?) mode. This is one half of a pair of mappings that I like to use to do tab navigation in vim:

" screw taglist; yay tabs!
nmap <C-[> :tabprevious<cr>
nmap <C-]> :tabnext<cr>

The latter rule works perfectly fine, but the former gives me this weird behavior when opening vim. After manually going back into normal mode, both mappings work as expected (changing the tabs).

What gives? Am I missing something simple here?

Btw, I'm using CLI vim (i.e., not MacVim) on OSX 10.5 via iTerm2. I've already combed through my entire .vimrc file and installed plugins and confirmed--even with all plugins disabled and all other options commented out--I get this behavior because of the line above.

share|improve this question
up vote 0 down vote accepted

You definitely do not want to map <C-[> to anything, since it is synonymous with mapping <esc>, which can really mess Vim up for you.

EDIT: Actually, mapping <esc> in normal mode is probably not as big an issue, but it's not a practice I would recommend.

I can reproduce your issue, but unfortunately I cannot figure out why it is happening or how to fix it.

share|improve this answer
    
Argh, well it is helpful to know that it is synonymous to <esc>, that explains some of it. Stinks though because I really liked using these for my tab navigation... – neezer Feb 3 '12 at 19:49
    
I'm about to report this to the Vim Developer's mailing list as a bug. – Heptite Feb 3 '12 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .