I gotta post this: Just changed the overall theming on one of my machines. The console now has white background rather then black, as opposed to all my other machines.
As a result I also need a different vim colorscheme.
Now, if I ssh onto my homeserver, I want that theme to still be applied to vim, without changing it for connections from other clients in the process. Here is how I solved it:
In the server's .bashrc:
Code:
export SSH_SOURCE_IP=$(echo $SSH_CONNECTION | cut -d' ' -f 1)
export VIM_COLOR_SCHEME="elflord" # my default scheme
if [ "$SSH_SOURCE_IP" == "192.168.1.225" ]; then
export VIM_COLOR_SCHEME="delek" # white background suitable
fi
And in /etc/vim/vimrc
Code:
colorscheme $VIM_COLOR_SCHEME
Amazingly, this does exactly what you'd think it does. When I log in from that one machine, I get delek. In all other cases, I get elflord. How cool ist this?