Thursday, September 24, 2020

Re: [vim colours + iTerm2 colours]

On 2020-09-23, Maxim Abalenkov <maxim.abalenkov@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.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/rkhnge%24120d%241%40ciao.gmane.io.

No comments: