I'm running vim (7.0.237) after sshing to a remote CentOS box, and it just won't enter visual mode.

When I press 'v', it just beeps and does nothing.

I'm running Ubuntu with GNOME Terminal, and the local copy of vi works fine, so I don't see how this could be a problem with the terminal. I have the same .vimrc file on the local and remote machines, and the only settings are: set nocompatible; set tabstop=4.

I'm at a total loss here, any ideas?

link|improve this question
feedback

4 Answers

up vote 7 down vote accepted

RedHat based systems have a package called vim-minimal installed by default, which has a limited set of features enabled. You want to install the vim-enhanced package.

Debian based systems do something similar, where vim-tiny is the default install and has a minimal feature set. Your Ubuntu system must have one of the other Vim packages installed (likely vim or vim-gtk) which is why it works fine there.

link|improve this answer
feedback

Well it actually seems like you can build vim without support for visual mode. Check the output of :ver and see whether it says +visual or -visual. Bad luck if it's the latter.

link|improve this answer
That's correct, thank you. I awarded the checkmark to the other answer, since he gave a bit more detail. – BobMarley Dec 14 '09 at 12:03
feedback

Are you sure that 'vim' is actually installed? Do you type vi or vim? Also, are you sure that visual mode in non-compatible vi works the same way?

link|improve this answer
Also, often vim is aliases as vi. – ldigas Dec 10 '09 at 12:52
Yes, I'm sure. It's vim version 7.0.237. – BobMarley Dec 10 '09 at 13:10
true - vim is aliases as vi. But is this the case? Often times distros install wrappers so the user can type 'vim' and still execute 'vi'. – lorenzog Dec 10 '09 at 13:56
feedback

Your local terminal settings are not necessarily transferred correctly via SSH; do other programs that use termcap/terminfo (e.g. top, less) work through the SSH link?

Another thing to try: manually setting the TERM environment variable to "vt100" and see whether that has any effect.

link|improve this answer
Yup, the 'v' key works fine in less. I don't see how this could be a terminal issue at all, in that case. Must be something weird with that particular version or configuration of vi. – BobMarley Dec 10 '09 at 12:53
feedback

Your Answer

 
or
required, but never shown

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