In Linux vim and gvim, I can make a visual selection by pressing V
(e.g., v
VISUAL or Shift
+V
VISUAL LINE), releasing it, and using movement keys (e.g., arrows) to highlight the desired text.
In Windows gvim, however, I must hold down Shift
while I make my selection. Also, Ctrl
+V
(block) selection is supplanted by the Windows paste, and I can select text without v
at all, like the common Windows method of Shift
+arrow keys. I don't want any of this in my vim.
This is a minor annoyance at best, but there's probably a way to make Windows use the former (Linux) behavior of only pressing V
once. I've scoured the docs to no avail. How can I dispense with all of this Windows stuff and get consistent behavior between my Windows and Linux environments?
Best Answer
When gvim starts, it sources a file called
mswin.vim
via the_vimrc
file. In themswin.vim
file the keys are remapped. You can undo this two ways. One is edit themswin.vim
file and remove the mapping (not recommended). A second easier potentially less invasive way is to edit the_vimrc
file.This should fix your problem.
If you want it to behave more like vi than vim, you can change
nocompatible
tocompatible