Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual mode in gVim on Windows doesn't work the way as it works in Unix

Tags:

vim

windows

I'm using gVim version 7.3 on my Windows. When using gVim in my Unix, to insert a common text at the beginning of each line in a file, I do the following steps:

  1. Enter visual mode (CTRL+V).
  2. Select the lines for which the text has to be inserted at the beginning using arrow keys or hjkl keys.
  3. After selection press Shift+I.
  4. The cursor goes to the begin of the line where I started. I enter some text and press ESC key.
  5. Now the entire block of lines has the text inserted at the beginning.

So here's my question. How do I do the same thing in my gVim on Windows? It's not working if I follow the above as on Unix. Could someone please help me out with this?

like image 648
sundar Avatar asked May 11 '11 06:05

sundar


1 Answers

If you have behave mswin in your vimrc then some of the Vim mappings are modified to be more "Windows-like". In particular you will need to use <CTRL-Q> to enter block-visual mode.

I have behave xterm in my Windows vimrc which eliminates these issues.

like image 179
Prince Goulash Avatar answered Nov 16 '22 02:11

Prince Goulash