5

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.

3 Answers3

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
  • 36,494
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
  • 23,415
0

In gvim 9.1, I can map both <C-V> & <C-S-V> on Windows and Linux(v9.1.0139). Just check with

nmap <C-V> :echo "C-V"<CR>
nmap <C-S-V> :echo "C-S-V"<CR>

Note: If <C-S-V> is mapped, I have to remap <C-V> as noremap <C-V> <C-V> to preserve the visual-block selection function of <C-V>.

robit
  • 101