From 09a84d1622f7ed1f9d644c14b8e8bd051e2699fc Mon Sep 17 00:00:00 2001 From: jdhao Date: Thu, 24 Oct 2019 12:10:06 +0800 Subject: [PATCH] Fix true color support issue Some terminal, for example, xshell, does not support true colors. In this case, we should not set the termguicolors option. --- ui.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui.vim b/ui.vim index 64b5c50..021c20a 100644 --- a/ui.vim +++ b/ui.vim @@ -4,7 +4,13 @@ " support true colors! For a comprehensive list of terminals supporting true " colors, see https://github.com/termstandard/colors and " https://bit.ly/2InF97t) -set termguicolors +if exists("&termguicolors") + if $TERM == "xterm-256color" + set termguicolors + else + set notermguicolors + endif +endif " Use dark background set background=dark