gruvbox icon indicating copy to clipboard operation
gruvbox copied to clipboard

Set terminal colors in Vim with termguicolors

Open rbong opened this issue 6 years ago • 7 comments

When the termguicolors setting is enabled, default ANSI colors are used by default in Vim.

Colors can be set in Vim similarly to neovim as of this merged PR:

https://github.com/vim/vim/pull/2747

See this issue for more context:

https://github.com/vim/vim/issues/2353

rbong avatar May 27 '19 18:05 rbong

Turns out that this is a duplicate of #246 and #261. I was searching for g:terminal_ansi_colors when checking for duplicates and I didn't get any results. However, since this is the only signed PR out of those right now, I'll leave it up.

rbong avatar May 27 '19 19:05 rbong

So, what happened? Why the code is gone? It's very ugly when using vim build-in terminal at now.

if exists('*term_setansicolors')
  let g:terminal_ansi_colors = repeat([0], 16)

  let g:terminal_ansi_colors[0] = s:bg0[0]
  let g:terminal_ansi_colors[8] = s:gray[0]

  let g:terminal_ansi_colors[1] = s:gb.neutral_red[0]
  let g:terminal_ansi_colors[9] = s:red[0]

  let g:terminal_ansi_colors[2] = s:gb.neutral_green[0]
  let g:terminal_ansi_colors[10] = s:green[0]

  let g:terminal_ansi_colors[3] = s:gb.neutral_yellow[0]
  let g:terminal_ansi_colors[11] = s:yellow[0]

  let g:terminal_ansi_colors[4] = s:gb.neutral_blue[0]
  let g:terminal_ansi_colors[12] = s:blue[0]

  let g:terminal_ansi_colors[5] = s:gb.neutral_purple[0]
  let g:terminal_ansi_colors[13] = s:purple[0]

  let g:terminal_ansi_colors[6] = s:gb.neutral_aqua[0]
  let g:terminal_ansi_colors[14] = s:aqua[0]

  let g:terminal_ansi_colors[7] = s:fg4[0]
  let g:terminal_ansi_colors[15] = s:fg1[0]
endif

PetrusZ avatar Feb 23 '20 16:02 PetrusZ

Oh, my bad. I didn't notice it not merged in to this repo. So, what we're waiting for? Why don't add terminal colors for vim? There already are terminal colors for neovim!

PetrusZ avatar Feb 23 '20 16:02 PetrusZ

@PetrusZ gruvbox is no longer actively maintained. Try out this fork which has the majority of the current pull requests merged and issues resolved: https://github.com/gruvbox-community/gruvbox

rbong avatar Feb 24 '20 16:02 rbong

@rbong gruvbox seems to become actively again, but I'll try gruvbox-community/gruvbox. Thank you.

PetrusZ avatar Feb 24 '20 16:02 PetrusZ

My bad, I did not see that new commits were recently added. Good to see commits on the original codebase.

rbong avatar Feb 25 '20 18:02 rbong

I'd rather say spare time activity maintainment 😉

morhetz avatar Feb 25 '20 18:02 morhetz