Search code examples
vimcolor-scheme

How do I set option variables for a colorscheme in vim?


The vim-lucius colorscheme provides several presets and a couple options that can be customized.

I cannot figure out how to override the preset background color to leave it as transparent/none. According to the documentation:

g:lucius_no_term_bg (default: 0)

Setting this will cause the color scheme to not set a background color 
in the terminal (useful for transparency or terminals with different 
background colors).

This is exactly what I want to accomplish. I tried adding let g:lucius_no_term_bg = 0 to my .vimrc but nothing happens and the background remains dark. Should I be setting these options directly in the lucius.vim file or in my .vimrc?

I have set t_Co=256 enabled. I'm using Terminal on Mac OS X 10.9.3.


Solution

  • That command is right, and as long as you put this before the :colorscheme lucius command in your ~/.vimrc, it should be considered by the scheme.

    You may be struggling with the negative configuration option (which is best avoided): To prevent setting the background, you need to enable the option (with a value != 0):

    let g:lucius_no_term_bg = 1
    

    As it stands, you're just setting the default (0), which does set the background.