I've been trying different colour schemes while manually setting a transparent background using hi Normal guibg=NONE ctermbg=NONE so my .vimrc file looks something like this

set t_Co=256
colo mycolorscheme
hi Normal guibg=NONE ctermbg=NONE

and this works fine for some colour schemes but not for others. For those that don't work, I get a different coloured background.

Examples of colour schemes that worked for me are Hybrid and onehalfdark and one example of theme that didn't work is the skin base16-bright from the Base16 suite

However, when I manually enter hi Normal guibg=NONE ctermbg=NONE after vim has loaded, I can get a transparent terminal background.

Why is it that for some colour schemes, the transparency background is automatically done via .vimrc but not for some others?


Editted to add examples of colour schemes that work and don't.

  • Welcome Zili, you should extend your question and name color schemes that work and that don't. – Ralf May 9 '19 at 17:28
  • Hey Ralf, thank you for your comment. I added some examples of colour schemes that work and don't. – Zili May 9 '19 at 17:59

There's no one, generic answer to your question. You'll need read the documentation for each color scheme that's giving you problems. For instance with Base16-Vim (which you linked as "Base16 suite") you'll find the following instructions for customizing the scheme

If you want to do some local customization, you can add something like this to your ~/.vimrc:

function! s:base16_customize() abort
  call Base16hi("MatchParen", g:base16_gui05, g:base16_gui03, g:base16_cterm05, g:base16_cterm03, "bold,italic", "")

augroup on_change_colorschema
  autocmd ColorScheme * call s:base16_customize()
augroup END

Really you should read all of the documentation as the installation for some of these is not the usual "drop it in the colors dir".

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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