When I ssh from work to the local network, I can turn syntax on in my vim instance and it works. When I go home and ssh in, I turn on syntax highlighting and nothing happens. While at home, if I use my local vim, I have syntax highlighting.

This leads me to believe it's something to do with ssh. In my ssh session, folders still have a different color than files.

echo $term for work computer:


echo $term when ssh from work computer:


echo $term when ssh from home computer:


echo $term from home computer:


(will add the others when I get home)


colorscheme elflord
set number
syntax on
  • 7
    echo $TERM and see what differs... – a CVn Aug 1 '13 at 19:09
  • Post your ~/.vimrc files. – user26112 Aug 1 '13 at 19:55

xterm-color is probably not a supported terminfo description on your work computers. You can verify this is the case by running infocmp. You'll likely get an error of infocmp: couldn't open terminfo file.

The fix for this is to set your TERM variable to something more common, for example just 'xterm' (in fact on my own system, the xterm terminfo description has more capabilities than the xterm-color description anyway).
I'm guessing you've got a bash profile/rc script which is setting this, as xterm does not set TERM=xterm-color by default. If so, just change it to xterm instead. If you don't have this set anywhere, just add export TERM=xterm to your ~/.bashrc (this is assuming you're using bash).

  • I'm not sure I follow. When I ssh from work, I get xterm-color on the remote machine. When I xterm from home, I get xterm. So I think xterm-color is supported and my home computer just isn't defaulting to xterm-color. – Xurtio Aug 9 '13 at 17:18
  • Ok, I tried the opposite of your suggestion. I set my home computer to TERM=xterm-color and all is fine now! Thanks for leading me to the answer! If you edit your answer to reflect my modification to it, I will accept it. Thanks again. – Xurtio Aug 9 '13 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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