nanotech / jellybeans.vim

A colorful, dark color scheme for Vim.
http://www.vim.org/scripts/script.php?script_id=2555
1.8k stars 315 forks source link

g:jellybeans_overrides does not override CursorLine color #68

Closed programus closed 7 years ago

programus commented 7 years ago
let g:jellybeans_overrides = {
\    'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\    'CursorLine': { 'ctermbg': '121212', '256ctermbg': '121212' },
\}

This would not change the background of current line. Is there any way to customize my current line bg color?

nanotech commented 7 years ago

256ctermbg is for 256-color terminals and accepts decimal color indices like 233, not 24-bit RGB hex colors. ctermbg is for 16-color terminals and also only accepts color indices.

Try this instead:

let g:jellybeans_overrides = {
\    'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\    'CursorLine': { 'guibg': '121212' },
\}

A guibg override will apply directly to GUI Vim and termguicolors terminals, and will be automatically converted to a color index for 256 and lower color terminals.

If you also want to set background to none on termguicolors terminals, but not GUI Vim, try

let g:jellybeans_overrides = {
\    'CursorLine': { 'guibg': '121212' },
\}
if !has('gui')
    let g:jellybeans_overrides['background'] = { 'guibg': 'none' }
endif
programus commented 7 years ago

Thank you for your advice.

I tried

let g:jellybeans_overrides = {
\    'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\    'CursorLine': { 'guibg': '121212' },
\}

and

let g:jellybeans_overrides = {
\    'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\    'CursorLine': { '256ctermbg': 233 },
\}

and also

let g:jellybeans_overrides = {
\    'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\    'CursorLine': { '256ctermbg': '233' },
\}

but none works. What mistake did I make?

nanotech commented 7 years ago

Those should all work on a terminal with 256-color support, and the first one should work everywhere. Make sure the let is before the colorscheme jellybeans call in your vimrc, check that cursorline is set, and maybe try a brighter color to test with to be sure the difference is visible and not hidden by monitor contrast or something.

nanotech commented 7 years ago

Closing for now, feel free to reopen if this isn't working for you.