10

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?

nwn
  • 583
  • 7
  • 23
sundar
  • 369
  • 2
  • 4
  • 10
  • You have to explain at which point of your process you are experiencing a problem. If you don't narrow down the problem/question it's going to be difficult to help you. So… start with the beginning: do you enter visual-block mode with ``? If yes, can you move with ``, ``, `j`, and/or `k`? If no, what does `` do? and so on… consider this problem as a big nested `if/else`, if you want. – romainl May 11 '11 at 07:03
  • It's quite likely the exact same question as this one (even if the keys that have been detected to behave differently aren't the same) http://stackoverflow.com/questions/289681/why-does-c-a-ctrla-not-work-under-gvim-on-windows?rq=1 – Luc Hermitte Jan 30 '17 at 07:35

1 Answers1

15

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.

Prince Goulash
  • 15,295
  • 2
  • 46
  • 47