I am using VIM in Windows. The problem is that I want to use CtrlV as a visual mode. However, this key has conflict with Windows paste. How can I reset
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.
Here's a modern day solution to this problem. It applies to the terminal version of Vim/Neovim, not the GUI version. If you use Microsoft's new-ish Windows Terminal (I highly recommend it.), you can redefine its key bindings to your advantage. The following section of the settings file is initially NOT commented out. If you comment it out, as I've shown, Ctrl+V
becomes the rectangular visual select key in Vim we all know and love.
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection
//{
// "command": {
// "action": "copy",
// "singleLine": false
// },
// "keys": "ctrl+c"
//},
//{
// "command": "paste",
// "keys": "ctrl+v"
//}
Now here's the weird part. I'd expected this to change the behavior of Ctrl+V
outside of Vim in the Terminal, so I checked. It still does a paste, but it's different than the Ctrl+Shift+V paste. Inside Vim, however, all is good: Ctrl+V
for rectangular select; and "*P
, Ctrl+Shift+V
, or Right Mouse Button
for pasting from the clipboard.