Not 100% sure if this is what you mean, but for me, when I'm running in the Linux console, $TERM is set to linux, and when I'm running in a terminal emulator it's set to e.g. xterm. (In GUI Vim it's entirely empty.) So: if $TERM == 'linux' set background=dark endif


The lazy way is to put hi SpecialKey ctermbg=NONE in your .vimrc after calling in your favorite colorscheme. Else you can read this gist and learn some true vim wizardry : https://gist.github.com/romainl/379904f91fa40533175dfaec4c833f2f Why SpecialKey ? The answer resides at the end of the :help 'listchars' section of the help pages.


If that needs to be done before vim is started what about using a bash alias? In your ~/.bash_alias file (or ~/.bashrc or ~/.zshrc) you could add the following: alias vimsn='vim-with-servername' vim-with-servername() { # Check we have one argument and it ends with .tex if [ "$#" -ne 1 ] || [[ ! "$1" =~ "\.tex$" ]]; then ...

Only top voted, non community-wiki answers of a minimum length are eligible