Simplify termguicolors handling

This commit is contained in:
Danielle McLean 2023-11-04 13:39:50 +11:00
parent a85fb47bb8
commit 6932873ac0
Signed by: 00dani
GPG key ID: 52C059C3B22A753E

View file

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