tags:

views:

4132

answers:

5

I am using VIM in Windows. The problem is that I want to use Ctrl-V as a visual mode. However, this key has conflict with Windows paste. How can I reset this key back to VIM visual mode instead of pasting. I prefer to set this in my _vimrc configuration file. Thanks for any help!

+4  A: 

I'm not sure there is a lot you can do about that. You can use Ctrl-Q instead though.

Starkii
+15  A: 

From the VIM documentation:

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

Alex
+1 saved me some time
Tom Dignan
I like this better than fiddling with _vimrc. It works immediately and since I am unlikely to be on serial terminals in the future, the Ctrl-S/Ctrl-Q flow control is a non-issue.
Michael Dillon
+3  A: 

If this line in your _vimrc troubles you:

behave mswin

then delete that line.

Windows programmer
+10  A: 

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.

jop
+1  A: 

The combination of jop's advice (looking for mswin.vim in the default _vimrc file) and "Windows programmer's" advice (getting rid of the "behave mswin" line) worked like a charm for me.

(my rep is too low to vote them up or combine them -- someone clean this up for me, or I'll come back once my rep is higher)

Rick Reynolds
In other words, were you trying to leave a comment?
molecules
Seems you never came back :)
ereOn
Heh, I'm an infrequent stackoverflow user (hence my low reputation)
Rick Reynolds