Here is an example:
print "This is the string."
Here, the quotes and the string value are highlighted in two separate colors, which shouldn't be like so. The string and the quotes should be of same color like vim does for other languages.
The different color of string and quotes distracts mind.
Ruby's string highlighting is uncommon but far from unique. The sh file type does something similar. php string delimiters get no highlighting at all. (Hands up if you're surprised the PHP highlighting does something stupid.) Many obscure file types do the same thing as vim-ruby.
This has come up before. My recollection is that the string delimiter highlighting is controversial but popular. I'm partial to it myself. It helps to set strings apart from other literals like numbers and booleans. That said, I'll change it if it's the will of the people.
You have drawn to my attention that symbols are highlighted inconsistently, which irks me. [:foo, :'foo', %s(foo)]. Yuck!
[:foo, :'foo', %s(foo)]
Let the bikeshedding begin.
Welp, I only just noticed that it's different. Now I can't unsee.
👍 For keeping it this way.
I prefer current behavior as well.
I prefer the current string highlighting behavior.
Never noticed it was different in other syntaxes! It works well with my colour scheme as the quotes as just slightly darker, making the string text 'pop' more. Please keep it.
rubyStringDelimiter is linked to Delimiter, as it should be. It just happens that Delimiter is linked to Special by default. There's nothing stopping you from customizing this yourself by changing the link or applying your own colors.
hi link rubyStringDelimiter String " ! necessary if used after ruby syntax has been loaded
I like being able to set the colors for string delimiters, for heredocs it really helps.
OK, how to just make " and ' of string color?
Add the line @graywh suggested to ~/.vim/after/syntax/ruby.vim
@dkearns I was talking just about the " and ', without affecting other delimiters (e.g. heredocs).
Sorry, the "just" wasn't emboldened in the first comment, at least in the email, and I misread it.
The simple solutions for syntax alone will, I expect, break indenting.
We could provide a different delimiter syntax group for heredocs I guess. What about the generalized delimiter string syntax?
@santosh By just " and ', would you also include the other string quoting such as backtick or any of the %()-like constructs?
@dkearns Regex has it's own matchgroup, so may as well add one for heredoc.
@graywh no, just the quotes.
I vote for leaving it the way it is: delimiter and value are different.
What's up guys? 😸 @dkearns @graywh What have changed since then?