Vim Solarized + Ruby Highlighting

I have Solarized installed for Vim along with the proper ruby syntax highlighting, but my highlighting doesn’t seem to match that in the tutorials. Could anyone guide me here?

Mine:

Theirs:

Is this terminal vim or macvim/gvim?

The picture is from MacVim, but I get the same result when I open it in terminal vim.

You know, after looking at the photo on: http://ethanschoonover.com/solarized/vim-colors-solarized and tweaking my vimrc files, I’m not so sure that it is highlighting wrong…

Do you know of maybe a different version of solarized that highlights differently?

I do not. I don’t use solarized anymore, but when I did, I remember it being finicky about a number of things. Be sure your background color is set correctly. Be sure your terminal colors are set correctly (though you did say this was also a problem in MacVim). Be sure you have the right colors setting in vim. Etc.

Perhaps if you could post your vimrc someone might be able to help? Not to push you off on someone else, but StackOverflow might also have some more specific advice as you’re likely to find more people who use solarized there and perhaps had this same problem?

Thanks Derek, I’ve actually made this my mission today and done some digging. It appears in the latest version of solarized that he has some of the highlighting for ruby commented out. (see line 787: vim-colors-solarized/solarized.vim at master · altercation/vim-colors-solarized · GitHub )

I’m going to fiddle with those on my local file and see if I can get it the way I want it.

I grabbed solarized a few months ago and I can confirm the syntax highlighting in vim matches the tutorial. I realize this isn’t specifically what the OP asked, but if you load up solarized in atom, textmate, and vim you’ll notice that the syntax highlighting doesn’t match. This is because the former two use Textmate-specific language grammars, while vim uses its own.

I actually tried to edit the solarized.vim to make it the way I wanted, but it’s not accepting the change to just exe "hi! rubyLocalVariableOrMethod" . s:fg_blue .s:bg_back .s:fmt_none for some reason.

I found a blurb about it on StackOverflow, but it didn’t affect my settings.

Do you have ruby syntax installed?

Also do you have your Dotfiles or at least your vimrc and vim directory located on GitHub for us to look at?

I actually found the culprit inside of vim-ruby:

bundle/vim-ruby/syntax/ruby.vim
92:syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
2 Likes

Did you solve this by commenting out line 92? This doesn’t seem to work for me. Did you edit any other settings?

Try removing just:

display transparent

Ah thanks. That’s it. Now to get it working with the base16 solarized colortheme :smile:

No problem! I’m partially colorblind, but part of me loves the Solarized theme, so I was determined to make it work and tweak a few things.