markw
markw

Reputation: 630

set vim colorscheme based on putty session

How would I cause vim to startup with a different color scheme depending on whether or not I was connected via a PuTTY ssh session? I have a preferred color scheme that doesn't display correctly through putty, but I need to use putty sometimes when I'm connecting via public terminals.

Does PuTTY set any environment variables?

Upvotes: 0

Views: 691

Answers (1)

Nicolas
Nicolas

Reputation: 618

Puty seems to be able to set environment variables via Configuration->connection->data.

After that, you could do, in the .vimrc:

if !empty($VARIABLE_PUTTY)
    colorscheme my_putty_color_scheme
else
    colorscheme my_default_color_scheme
endif

Upvotes: 1

Related Questions