4

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.

muru
  • 24,838
  • 8
  • 82
  • 143
user1683793
  • 141
  • 1
  • 1
  • 3
  • 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. – user1683793 Apr 21 '17 at 20:55
  • Does the ctrl-v alternative ctrl-q work? See :help ctrl-v-alterantive. –  Apr 22 '17 at 12:55
  • 1
    I have the same thing happening. Neither Ctrl-V or Ctrl-Q work –  Apr 22 '17 at 23:06
  • In which terminal emulator are you running Vim? Is this same for both your and other user's environment? Do you run it locally or over ssh/vnc connection? Do you use same locale setting (and eventually input method if in X11 environment)? –  Apr 24 '17 at 19:54
  • Wow, I had not thought to experiment with that. Both are using teraterm and I downloaded putty and it works the same there, as well. I ran locale -a and the output is the same, echo $LANG, it is C in both cases. A new development, if I open an xterm and pbrun to the other user (pbrun is a proprietary sudo replacement), it stays broken but if I open an xterm as the other user, it works. moving forward. – user1683793 Apr 25 '17 at 01:33
  • 1
    Are you sure it is not working or is it perhaps just not displaying the highlighting correct? – Christian Brabandt Apr 25 '17 at 06:26
  • Good point. It is definitely not working. As my user, If I do a ^V block select and copy, I can paste the block as expected. If I execute the same keystrokes as the other user, I get something quite different (what I would expect if the block were not selected). – user1683793 Apr 25 '17 at 14:55
  • 1
    Could it be the terminal intercepting the "ctrl-v"? Can you try "CTRL-V" "CTRL-V"? – Christian Brabandt Apr 25 '17 at 18:25
  • Wow. I can't believe it. If I type CTRL-V twice in a row, it works. ("Take two, they're small" I always say.) Thanks. So the other user has something goofing up their environment so CTRL-V does not get to VIM? That is going to take yet another bit of research. Thanks again. – user1683793 Apr 26 '17 at 03:25
  • I just spent too much time moneying around trying things. If I set "stty lnext ^P" BEFORE using PBRUN to switch to the other user, I ^V works. If I set "stty lnext ^P" AFTER switching to the other user, I need to double up the ^V for block select or it does not work. I would love to fully get to the bottom of this but I can work with it this way. – user1683793 Apr 26 '17 at 04:01

1 Answers1

3

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.

mark79
  • 31
  • 3