Improve terminal colour handling

This commit is contained in:
Anthony Rose 2018-01-15 09:17:49 +00:00
parent d1a95a0107
commit 7ddeff0400

16
vimrc
View file

@ -85,13 +85,15 @@ if has("eval")
let g:netrw_liststyle=3
let g:netrw_sort_sequence='[\/]$,*'
let g:netrw_winsize=-28
" Use 256-color mode unless at the Linux console or in Eterm.
if &t_Co == 8
if $TERM !~# '^linux\|^Eterm'
set t_Co=256
else
set t_Co=16
endif
" Set colour levels for different terminals.
if &term == "rxvt-unicode"
set t_Co=256
elseif &term == "xterm"
set t_Co=256
elseif &term == "linux"
set t_Co=16
else
set t_Co=16
endif
endif