vim

Client-specific Config on remote Server

If you are logging in on an SSH server from different machines you may want vim to be configured differently, based on the machine from which you are connecting. Here is how to do it. On the server, add the following lines to the .bashrc of the login user:

# Client-specific Customisation
export VIM_COLOR_SCHEME="evening"
export SSH_SOURCE_IP=$(echo $SSH_CONNECTION | cut -d' ' -f 1)
if [ "$SSH_SOURCE_IP" == "192.168.1.105" ]; then
        export VIM_COLOR_SCHEME="delek"
fi

192.168.1.105 is the ip of the client that should get the "delek" scheme. All others will get "evening"

Now, all you have to do is adjust the colorscheme setting in /etc/vim/vimrc:

colorscheme $VIM_COLOR_SCHEME