Jared wrote:
Ok, this will be my last question for the night (promise!). I'd like to map
separate commands to Ctrl-C and Ctrl-Shift-C. I've tried a couple different
ways to do it, but this one seems like it should be most "correct":
vnoremap <C-c> "+y
vnoremap <C-S-c> ^Gol"+y
What's happening, though, is that the C-S-c map overwrites the C-c map. If
I were to place C-c below C-S-c in .vimrc, the it'd be the other way around.
So, two questions: 1) Am I defining the <C-S-c> mapping correctly? I
believe that's how it's done, but I couldn't find a specific example in the
docs. 2) How do I make Vim distinguish between the two commands?
Actually, I also have a 3rd, pseudo-related question: How do I include a
control key sequence in a map? I'm using ^G in the above example, but that
seems to be completely ignored when I hit <C-S-c>. I also tried <C-g>, but
that's also ignored.
Thanks once again. Believe me when I say that I'm most appreciative of the
help that's constantly offered on this mailing list.
--
Jared
You're out of luck there: Ctrl-Shift-C and Ctrl-C both correspond to
0x03, Vim cannot tell them apart. Similarly for Ctrl + any letter key
with or without Shift. Vim _can_ distinguish, let's say, Ctrl-F5 and
Ctrl-Shift-F5 because those are represented differently in its input
stream. Provided of course that a window manager doesn't intercept those
key sequences before Vim has a chance to see them (mine does :-( ).
You ought to be able to include <C-G> (or <C-g>) in a mapping, see
":help <>" for examples. But of course if that mapping is overridden by
another with identical (or equivalent) {lhs}, you won't see it.
Best regards,
Tony.