VIM Ctrl-V Conflict with Windows Paste

Solution 1:

From the VIM documentation:

Since CTRLV is used to paste, you can't use it to start a blockwise Visual selection. You can use CTRLQ instead. You can also use CTRLQ in Insert mode and Command-line mode to get the old meaning of CTRLV. But CTRLQ doesn't work for terminals when it's used for control flow.

Solution 2:

Check your _vimrc file and see if it sources mswin.vim. That script maps the ^v to the paste. You can either remove that line on your _vimrc file or disable the mapping commands directly on mswin.vim.

Do a :help behave on vim for more info.

Solution 3:

Visual mode (and other stuff) working like in Unix requires both JOP's and Windows Programmer's suggestions.

In GVim on Windows, go to the edit menu, click on startup settings, and comment out the windows-specific garbage (using the vimrc comment character, which is a double-quote). The mswin.vim file is where the ctrl-v override is specified, and the behave mswin option makes it so that the arrow keys don't just apply motion like you'd expect (it also changes the mouse selection behavior).

"source $VIMRUNTIME/mswin.vim
"behave mswin

I like to add a black-background colorscheme in there as well, so it looks more like what I'd see in a terminal (and because a light background is great on paper, but awful on a backlit screen): colorscheme koehler

Solution 4:

If this line in your _vimrc troubles you:

behave mswin

then delete that line.

Solution 5:

I prefer the same keystrokes everywhere so I use this in my .vimrc to override mswin.vim:

if has('win32')
  " Avoid mswin.vim making Ctrl-v act as paste
  noremap <C-V> <C-V>
endif