agude / vim-eldar

A dark color scheme for vim based on Elflord.
MIT License
72 stars 13 forks source link

Error: Pattern not found: eldar_red = "#ff0000" #5

Closed magoz closed 5 years ago

magoz commented 5 years ago

I'm getting the following errors when I want to change the colors.

Pattern not found: eldar_red     = "#ff0000"
Pattern not found: eldar_yellow  = "#ffff00"
Pattern not found: eldar_green   = "#00ff00"
Pattern not found: eldar_cyan    = "#00ffff"
Pattern not found: eldar_blue    = "#0000ff"
Pattern not found: eldar_magenta = "#ff00ff"

I just pasted the config from the docs after installing Eldar.

"------------------------
" Syntax: highlighting
"------------------------
if has('syntax')
    " Override Eldar GUI colors
    g:eldar_red     = "#ff0000"
    g:eldar_yellow  = "#ffff00"
    g:eldar_green   = "#00ff00"
    g:eldar_cyan    = "#00ffff"
    g:eldar_blue    = "#0000ff"
    g:eldar_magenta = "#ff00ff"

    syntax enable             " Turn on syntax highlighting
    silent! colorscheme eldar " Custom color scheme
endif

I've tried with other properties as suggested in the docs:

g:eldar_text        = "#D3D3D3"
g:eldar_background  = "#2B2B2B"
g:eldar_term_text        = "White"
g:eldar_term_background  = "Black"

But I'm getting the same errors.

Any ideas about what can be wrong? I'm using iTerm 2 & zsh on the latest version of macOS Mojave.

Thanks,

agude commented 5 years ago

It's because I have a very silly bug in the README; you should use let g:eldar_red = "#ff0000".

Does that work for you?

agude commented 5 years ago

Also of note: the custom colors only work in the GUI. You're probably using the terminal version (since you mention iTerm 2 and zsh), in which case you can customize the colors by changing your terminal colors. 😄

magoz commented 5 years ago

Thank you so much for your quick answer. It indeed fixed the error!

Playing around I saw I could change the colors in iTerm 2, but wondered if I could just use that extra customization to apply new colors to vim exclusively. I've done some testing and it looks like the custom colors set in .vimrc don't override the ones set in iTerm2.

I've also realized that the colors that are used are the Bright versions in iTerm2 settings.

Screenshot 2019-07-23 at 08 53 16

So, I've tested if something like let g:eldar_red_bright = "#ff0000" would work. But it didn't.

I assume that's what you meant by

the custom colors only work in the GUI

I'm a newbie in Vim and working with shells, and I'm still learning which part of the config is applied where (iTerm, Zsh, Oh My Zsh, and Vim).

Thanks again for your help!

agude commented 5 years ago

Yeah, I only define overrides for the GUI.

That's in the code here: https://github.com/agude/vim-eldar/blob/master/colors/eldar.vim#L56-L65

Here is an example of where I set colors using those: https://github.com/agude/vim-eldar/blob/master/colors/eldar.vim#L156

You can see I use the GUI color variable s:cyan (which you can override with g:eldar_cyan), but I hard-code the terminal color as cyan which is whatever color your terminal uses for cyan. As you found, you can change that terminal color in the iTerm2 settings, but that does change it everywhere!

I don't think I'll add in variables to customize the terminal, because I like having the same color in my normal bash shell and vim terminal. Once you take that as a constraint, the real customization would be changing the highlight groups (for example, make comments red instead of cyan) and at that point you're basically writing a new colors scheme. 😄

So I'll close this, but if you'd like to customize the scheme, feel free to leave more comments here and I can try to give you a hand.

magoz commented 5 years ago

Thanks for taking the time to respond and for the explanation. I very much appreciate it!

I think I'll keep the colors as they are :-)