On 2020-09-23, Maxim Abalenkov <
maxim.a...@gmail.com> wrote:
> Thank you for your reply. I will check. I'm not certain about the "gui"
> part of the command. I'm not using Gvim.
The termguicolors option is specifically for terminals supporting
millions of colors, such as iTerm2. It tells Vim to use the "gui" color
specifications of the color scheme you are using (as opposed to the
"cterm" color specifications). Provided that your color scheme defines
guifg and guibg colors for each highlight group (and most color schemes
do), Vim will use such colors, independent of which colors your terminal
is set to display. See `:help termguicolors`, `:help highlight-guifg`,
`:help highlight-ctermfg`.
Some terminals define an environment variable called $COLORTERM to
advertise their color capabilities. Although that is not standard or
universal, it works with iTerm2. So, if you put this snippet in your
vimrc:
if has('termguicolors') && $COLORTERM ==# 'truecolor'
set termguicolors
endif
then termguicolors will be set automatically when you open Vim in
iTerm2.
Hope this helps,
Life.