Take the 2-minute tour ×

I've been using Vim exclusively for a few weeks now, and a few things are keeping me from being very excited about my experience so far. For one, I am having trouble mapping a few key sequences to commands.

I'd like to map Ctrl+Shift+Z to :redo<CR> or alternately <C-R>, but apparently Vim is not able to recognize the difference between shifted and un-shifted control-key sequences:

Ctrl-b and Ctrl-B are synonymous, they both mean 0x02. This cannot be changed, it goes back to ASCII, which dates back to 7-hole paper tape (not counting parity).

This just seems silly to me. We've come a long way since 7-hole paper tape, and in my experience MANY programs recognize the difference between <C-S-Z> and <C-Z>. Indeed, MacVim even recognizes the difference! But no joy in GVim or in the GNOME Terminal. Is there a way around this? Maybe a plugin or even some compile-time option?

The other key combo that I'm having trouble with is Ctrl+, (control+comma). I'm not sure if I've got something configured wrong in my .vimrc, or if it's a real issue with Vim, but I cannot get <C-,> to respond after mapping it (for example: map <C-,> :TComment<CR>). FWIW, I have my leader key remapped to ;. Am I doing it wrong? Or is there some other reason why Vim won't recognize the <C-,> key combo?

I've spent way too much time googling and fiddling with key mappings, and I'm on the verge of declaring that Vim is not as flexible as I've been led to believe... I can't even get it configured with the key mappings I'm used to, some of which I am reluctant to re/unlearn since they work in other programs that I use daily.

share|improve this question
Why not do it the Vim way? I did, and I find it much easier. For example, pushing u is a lot easier than Ctrl-z, and r is much easier than Ctrl-Shift-z. Also, it's much easier to pick up someone else's computer and use vim if you're already using the default key bindings. –  tjameson Jul 12 '11 at 4:34
You're doing it wrong. You should be remapping all of your other programs to use VIM key bindings! –  janm Jul 12 '11 at 4:39
Given your modifiers choice, you might want to try Emacs :D –  Matteo Riva Jul 12 '11 at 12:48
add comment

2 Answers

up vote 4 down vote accepted

It looks like the link you posted already answers your question regarding <C-b> vs. <C-B>. According to the FAQ it looks like you're out of luck with <C-,> as well, since this key combination is not in the list of Ctrl-printable-key chords that Vim can detect (possibly because it's not even a printable ASCII chord?).

Key combinations such as <C-S-w> are very un-Vim-like in that they undermine the efficiency of a modal editor. Of course there are times when <CTRL>-escaped combinations are necessary (for example in insert-mode mappings such as <C-x>-<C-o> for omnicompletion), but that's not the case for operations such as undo and redo.

I'm sorry that this reply won't satisfy you, but in the long run there is much to be gained from "doing it the Vim way", rather than trying to bend Vim to your will.

share|improve this answer
Bummer, I had high hopes for Vim, but this is a deal breaker for me. I'm not interested in reprogramming my brain to something so different from the norm that I'll want every other program to act like Vim. Frankly it surprises me that Vim is not the most configurable editor out there. Thanks for providing a truthful answer anyway. –  millerdev Jul 15 '11 at 13:48
add comment

Try adding set nocompatable to your vimrc. without this you are basically running vi wich is much more limited than vim. This should allow you to map <C-S-r> or <F11> or whatever else you want. Tjameson is completely right. it is much better to use the default mappings where they exist.

share|improve this answer
I don't think set nocompatible has any effect on the equivalence of <C-S-r> and <C-r>; at least not for me. –  Prince Goulash Jul 12 '11 at 15:39
I did some extra testing and it looks like it doesn't make a difference for ascii characters but you can map non ascii charecters with shift modifiers. for example I mapped: map <C-Tab> :tabnext map <C-S-Tab> :tabprev these do work correctly –  Sam Brinck Jul 12 '11 at 16:42
it seems to fix it for me.. –  eventualEntropy Dec 13 '12 at 18:49
add comment

Your Answer


