tags:

views:

191

answers:

2

In a terminal, one cannot distinguish Ctrl+A and Ctrl+Shift+A as they both emit the same key code, so I can see why vim can't do it. But gvim, being an X application, can differentiate Ctrl+A and Ctrl+Shift+A. So is there any way to map those two things differently?

For starter, I'd like to do something like the following, to make "paste from clipboard" work like gnome terminal, while keeping Ctrl+V to the visual mode.

:nmap <C-S-V> "+gP
A: 

as you've noted, you get the same keycode. so the only way to distinguish them is to check the state of the Shift key in your event handling function. of course, if you have more than .5sec delay between keypress and processing, you'll miss some hits

Javier
I guess the point of my question was that given that gvim is capable of making such a distinction (even though plain vim cannot), is there any gvim-specific extension that I could rely on to differentiate Ctrl+Shift+V vs Ctrl+V.
Kohsuke Kawaguchi
A: 

Gvim doesn't do it because vim cannot do it. Sorry, but that's just how it is.

graywh