2

I have a gruvbox theme applied to Vim inside my vimrc. The problem is that when I run the :terminal command inside Vim the colorscheme is different from either the Vim theme or the terminal emulator's theme.

I have tried this on Hyper and iTerm2 with the same results. Somehow neither of the colorschemes are applied to the :terminal. I did try looking at the discussions in github, but my knowledge of Vim is not sufficient to understand it.

Can someone explain the problem and the solution? I am running Vim version 8.2.900, Hyper 3.0.2, iTerm 3.3.10.

6
  • 1
    The colorscheme may need to set the terminal colors via some special variables. Welcome to Vi and Vim!
    – D. Ben Knoble
    Jul 4, 2020 at 2:16
  • What is that special variable and how? I'm not that proficient in vim scripting just yet. Thank you! Jul 4, 2020 at 11:35
  • I believe it’s g:terminal_ansi_colors; you can search the plugins code for that and also check the help.
    – D. Ben Knoble
    Jul 4, 2020 at 15:34
  • Oh yes I got it working! I just copy pasted from some of the other themes. Thank you! Jul 28, 2020 at 9:49
  • please add an answer if you solved the problem ! Self-answering is accepted and encouraged here, and you’ll be able to accept the answer after a few days. It will help others learn, too!
    – D. Ben Knoble
    Jul 28, 2020 at 13:22

1 Answer 1

2

This was the color schemes defined in paper color theme. Just pasting this in the vimrc worked!

let g:terminal_ansi_colors = [
  \'#eeeeee', '#af0000', '#008700', '#5f8700',
  \'#0087af', '#878787', '#005f87', '#444444',
  \'#bcbcbc', '#d70000', '#d70087', '#8700af',
  \'#d75f00', '#d75f00', '#005faf', '#005f87' ]

Your Answer

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

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