I use GVim with the gruvbox colorscheme. When I open a terminal inside vim with :term, the colors are different, it looks like another colorscheme is applied.

enter image description here

The other terminals I use (urxvt and xfce4-terminal) also look nothing like what I see in the vim terminal.

Where is the coloscheme of the vim terminal buffer configured and how can I change it ?

  • Why do you think it is different in terminal in your case? Normal foreground and background in terminal looks the same as in your buffer.
    – Maxim Kim
    Commented May 21, 2020 at 8:38

3 Answers 3


In GVim, you can control the 16 ANSI colors used by your terminal with the g:terminal_ansi_colors variable.

See :help g:terminal_ansi_colors:

In GUI mode or with 'termguicolors', the 16 ANSI colors used by default in new terminal windows may be configured using the variable g:terminal_ansi_colors, which should be a list of 16 color names or hexadecimal color codes, similar to those accepted by highlight-guifg. [...]

The term_setansicolors() function can be used to change the colors, and term_getansicolors() to get the currently used colors.

  • There's also the Terminal highlight group to define default foreground and background colors. But I think in your case the 16 ANSI colors is where you're seeing the differences... Right?
    – filbranden
    Commented May 21, 2020 at 8:46
  • But where do I find the colors of the current vim colorscheme that I would like to extend to the terminal buffer?
    – kksagar
    Commented Mar 21, 2023 at 10:39

I had the same question (I am using vim 8.2) and a google search brought me here. I searched vim help for g:terminal_ansi_colors and made a list as they suggested of rgb values for gruvbox using the neutral and bright colors listed here: https://github.com/morhetz/gruvbox-contrib/blob/master/color.table. Then I searched more and found you need to set highlight Terminal guibg= and same for guifg to have a gruvbox background. This code in vimrc gave me a nice gruvbox themed terminal:

let g:terminal_ansi_colors = [
  \'#282828', '#CC241D', '#98971A', '#D79921',
  \'#458588', '#B16286', '#689D6A', '#D65D0E',
  \'#fb4934', '#b8bb26', '#fabd2f', '#83a598',
  \'#d3869b', '#8ec07c', '#fe8019', '#FBF1C7' ]

highlight Terminal guibg='#282828'
highlight Terminal guifg='#ebdbb2'
  • Note that you can write :highlight Terminal guibg=… guifg=… on the same line.
    – D. Ben Knoble
    Commented Sep 7, 2022 at 2:36
  • Thanks for this reply, which helped me. For the record, some Vim color schemes already include this off the shelf. Like for instance github.com/jnurmine/Zenburn. With the latest version from that repo, when I open :term, I get the exact same color scheme as in other buffers, which is great. Might actually mean I will no longer CTRL-Z from Vim like I so much used to!
    – nilo
    Commented Mar 5 at 23:14

In modern vim/neovim there is :h g:terminal_ansi_colors (vim) or 16 of g:terminal_color_0 .. g:terminal_color_15 (neovim).

If you open gruvbox colorscheme you use, you will find those definitions there (most probably).


  1. your whatever terminal can have palette of base 16 colors defined (there are defaults for each type of terminal, but you can also redefine it).
  2. In Vim when you open a :term those default/redefined base 16 colors are applied to it unless you or a colorscheme again redefine them with g:terminal_ansi_colors to match your colorscheme

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.