← Back to Upcase

Vim Solarized + Ruby Highlighting

(Adam White) #1

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?



(Derek Prior) #2

Is this terminal vim or macvim/gvim?

(Adam White) #3

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

(Adam White) #4

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?

(Derek Prior) #5

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?

(Adam White) #6

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: https://github.com/altercation/vim-colors-solarized/blob/master/colors/solarized.vim )

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

(Jeffrey Horn) #7

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.

(Adam White) #8

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.

(Brian) #9

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?

(Adam White) #10

I actually found the culprit inside of vim-ruby:

92:syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent

(Sander Kuijper) #11

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

(Adam White) #12

Try removing just:

display transparent

(Sander Kuijper) #13

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

(Adam White) #14

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.