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

When trying to override, getting errors #73

Closed meskarune closed 5 years ago

meskarune commented 6 years ago

I added the following to my vimrc from your readme file:

128   let g:jellybeans_overrides = {                                                  
129       'background': { 'ctermbg': 'none', '256ctermbg': 'none' },                  
130   }

Then when I start vim I get these errors:

Error detected while processing /home/meskarune/.vimrc:
line  128:
E15: Invalid expression: 
E15: Invalid expression: {
line  129:
E20: Mark not set
line  130:
E492: Not an editor command: }

If I change line 128 to this:

128 let g:jellybeans_overrides = {'background': { 'ctermbg': 'none', '256ctermbg': 'none' },}

vim runs without errors but the colors are not changed from the default. Am I doing something wrong?

nanotech commented 6 years ago

Vimscript doesn't implicitly continue unclosed expressions across lines, unlike most other languages. Subsequent lines need to be prefixed with a line-continuation backslash:

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

As for the colors changing, what a background set to none will look like depends on the terminal you use and the colors it has set. What does it look like now, and how do you want it to look?

meskarune commented 6 years ago

This is standard x-term with the above added to .vimrc:

terminalvimcolors

the background in vim should be black - the default terminal background, but it's instead the default jellybeans background. I want the background color to always match whatever the terminal background color is.

vinnyA3 commented 6 years ago

Same problem here. Using st as a terminal emulator.

[EDIT]: Was a bit premature with my comment here ... Upon some light digging, I found all I needed to do was set the guibg field to none in the jellybeans_overrides collection ...

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

reference issue: https://github.com/nanotech/jellybeans.vim/issues/58

I'm no longer stuck with the default jellybeans background :smiley:

meskarune commented 6 years ago

@vinnyA3 That doesn't seem to work for me. I tried in xfce4-terminal, qterminal, termite and xterm. :/

vinnyA3 commented 6 years ago

@meskarune Can you try adding it inside an if clause?

if has('termguicolors')
  set termguicolors
  let g:jellybeans_overrides = {
  \    'background': { 'ctermbg': 'none', '256ctermbg': 'none', 'guibg': 'none' },
  \}
  colorscheme jellybeans
endif

...This might do it for you :crossed_fingers:

nanotech commented 5 years ago

This should hopefully be addressed by the improved example in b02f1f34818d7eb559dfa8808607ca4c885c1eee. Go ahead and re-open or start a new issue if you're still having trouble.