Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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:

xterm-color

echo $term when ssh from work computer:

xterm-color

echo $term when ssh from home computer:

xterm

echo $term from home computer:

xterm

(will add the others when I get home)

.vimrc:

colorscheme elflord
set number
syntax on
share|improve this question
7  
echo $TERM and see what differs... –  Michael Kjörling Aug 1 '13 at 19:09
    
Post your ~/.vimrc files. –  paraxor Aug 1 '13 at 19:55

1 Answer 1

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).

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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