5

I am running Vim version 8.0.563 on Solaris and when I run Vim, the CtrlV block selection works as expected, I type ^V and move the cursor and a block of text is highlighted by columns. So far, so good.

Meanwhile, for another user running Vim from my directory with my .vimrc file, this does not work. The ^V is ignored and moving the cursor, moves the cursor but nothing is highlighted. Regular v, block mode works but the ^V column block mode is broken.

I tried entering:

vim --noplugin -u /dev/null

and it acts the same. I checked the shared libraries and they are the same. I tried clearing out (almost) all the environment variables, still no joy.

Does anybody have any good ideas of what is wrong or something else to try?

Thank you in advance.

10
  • Or would I do well to repost this over in the VI/VIM area? There are lots of VIM questions here but nobody has commented. If I ask a C question, I get answers in seconds. I guess I'll wait a few days and see how it goes. Commented Apr 21, 2017 at 20:55
  • Does the ctrl-v alternative ctrl-q work? See :help ctrl-v-alterantive.
    – Habi
    Commented Apr 22, 2017 at 12:55
  • 1
    I have the same thing happening. Neither Ctrl-V or Ctrl-Q work
    – Bob Bryan
    Commented Apr 22, 2017 at 23:06
  • 1
    Are you sure it is not working or is it perhaps just not displaying the highlighting correct? Commented Apr 25, 2017 at 6:26
  • 1
    Could it be the terminal intercepting the "ctrl-v"? Can you try "CTRL-V" "CTRL-V"? Commented Apr 25, 2017 at 18:25

1 Answer 1

5

I had the same problem when working in the windows terminal via Windows Subsystem for Linux (WSL). Some searching learned me that the problem is caused by the fact that CTRL-V is used for pasting. The solution for me was to add:

nnoremap q <c-v>

to my .vimrc Then you can use the q-key to get into visual block mode.

5
  • 1
    I noticed the same in Windows Terminal, because it intercepts the ctrl-V and pastes from the clipboard. My work-around is to use ` {"command": "paste", "keys": ["ctrl+shift+insert"]},` in the config Commented Oct 19, 2020 at 14:40
  • 2
    Welcome to Vi and Vim! Did <C-q> not work for you? (:help CTRL-V-alternative)
    – D. Ben Knoble
    Commented Oct 19, 2020 at 15:19
  • 1
    No, <C-q> does not work, unfortunately
    – mark79
    Commented Oct 20, 2020 at 19:48
  • 1
    Just a note that this hides the macro-recording key, which can be extremely useful.
    – D. Ben Knoble
    Commented Oct 20, 2020 at 20:42
  • I decided to use <M-v> in WSL. It worked. Thanks.
    – nfgf
    Commented Apr 16 at 19:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.