[vim/vim] How can I reset g:terminal_ansi_colors to defaults? (Issue #11400)

89 views
Skip to first unread message

Jason Gomez

unread,
Oct 19, 2022, 12:14:55 AM10/19/22
to vim/vim, Subscribed

I absolutely love using vim and gvim and use them on Linux and Windows.

With gvim I use the PaperColor colour schame, which is very nice, but on Windows it messes up the terminal colours so my ls.exe (port) LS_COLORS are all wrong.

There is an explanation as to why here, but I don't really understand it.

I tried setting g:terminal_ansi_colors but this didn't work, but when I accidentally added colors without the #hash signs, I got an error, but the LS_COLORS were all reset to default, seemingly without any problem caused with using the theme on normal text buffers.

let g:terminal_ansi_colors = [
  \'282C34', 'E06C75', '98C379', 'E5C07B',
  \'61AFEF', 'C678DD', '56B6C2', 'DCDFE4',
  \'E9969D', 'B3D39C', 'EDD4A6', '8FC6F4',
  \'D7A1E7', '7BC6D0', 'F9F9FA', '5A6374' ]

The above results is resetting g:terminal_ansi_colors, but I get this error message:

E254: Cannot allocate colour 282C34
E475: Invalid argument: g:terminal_ansi_colors

So it seems to be possible to reset g:terminal_ansi_colors, as this error causes it to do that. How can I make gvim reset the terminal colours without causing an error?


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11400@github.com>

Christian Brabandt

unread,
Oct 19, 2022, 2:58:02 AM10/19/22
to vim/vim, Subscribed

I may not understand the problem, but if you do not want to set the terminal colors, have you tried to remove/unlet the g:terminal_ansi_colors variable? That would be :unlet! g:terminal_ansi_colors (the bang is there so that vim does not complain in case the variable does not exist)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11400/1283523488@github.com>

Jason Gomez

unread,
Oct 19, 2022, 10:58:48 AM10/19/22
to vim/vim, Subscribed

Closed #11400 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/11400/issue_event/7622530089@github.com>

Jason Gomez

unread,
Oct 19, 2022, 10:58:54 AM10/19/22
to vim/vim, Subscribed

Yes, that worked. I didn't need to use the bang. Thanks!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11400/1284152230@github.com>

Reply all
Reply to author
Forward
0 new messages