diff --git a/dot-config/vim/init.vim b/dot-config/vim/init.vim index a8e0cc6..ed3e6bd 100644 --- a/dot-config/vim/init.vim +++ b/dot-config/vim/init.vim @@ -18,11 +18,10 @@ if !isdirectory($XDG_CACHE_HOME .. '/vim/pack') PackUpdate endif -if has('gui_running') || has('termguicolors') - if $COLORTERM == 'truecolor' - &t_8f = "\[38:2:%lu:%lu:%lum" - &t_8b = "\[48:2:%lu:%lu:%lum" - endif +# If both Vim and the terminal it's running in support true colour, use it. +# Otherwise we just fall back to 256-colour mode, or even the old 16-colour +# mode if necessary! +if has('termguicolors') && $COLORTERM == 'truecolor' set termguicolors endif