4

Is there a way to map paste to control+shift+v, and leave visual block mode as control+v in gvim?

I use both quite often.

OregonTrail
  • 237
  • 2
  • 11
  • Just use the built-in `"+p` or [`i Ctrl-R +`](http://stackoverflow.com/a/22433635/405550). – Zaz Feb 12 '15 at 08:41

2 Answers2

4

This is not an authoritative answer, but there doesn't appear to be any way to distinguish between Ctrl+Shift+<letter> and Ctrl+<letter> in gvim.

I tested this using gvim 7.3.138 for Windows and gvim 7.3.189 for X on Linux. I entered insert mode, typed Ctrl-V to insert the next key literally (see ":help i_CTRL-V"), then typed Ctrl-V. The result appeared as ^V. I repeated the experiment, typing Ctrl-Shift-V at the end. The result again appeared as ^V.

There is also a to-do item (":help todo.txt") that suggests that handling the two cases separately is not implemented but is being considered.

8 Should mapping <C-A> and <C-S-A> both work?

garyjohn
  • 34,610
  • 8
  • 97
  • 89
2

<C-v> already does what you want.

For the other one it's going to be more complicated: Some (most?) terminals treat <CONTROL><SHIFT> exactly like <CONTROL>. So <CONTROL><SHIFT>v will probably work in GVim but the the mapping will be useless in regular vim.

Also, which "paste" do you want to map: p or P or "_dP or another one?

romainl
  • 22,554
  • 2
  • 49
  • 59