Please change the color highlight with strings. #135

Open
santosh opened this Issue Mar 8, 2013 · 16 comments

Projects

None yet
@santosh
santosh commented Mar 8, 2013

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.

Owner
tpope commented Mar 8, 2013

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!

reinh commented Mar 8, 2013

Let the bikeshedding begin.

richo commented Mar 8, 2013

Welp, I only just noticed that it's different. Now I can't unsee.

👍 For keeping it this way.

cmaggard commented Mar 8, 2013

I prefer current behavior as well.

mhinton commented Mar 8, 2013

I prefer the current string highlighting behavior.

Odaeus commented Mar 8, 2013

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.

graywh commented Mar 8, 2013

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.

santosh commented Mar 9, 2013

OK, how to just make " and ' of string color?

Owner
dkearns commented Mar 9, 2013

Add the line @graywh suggested to ~/.vim/after/syntax/ruby.vim

santosh commented Mar 9, 2013

@dkearns I was talking just about the " and ', without affecting other delimiters (e.g. heredocs).

Owner
dkearns commented Mar 9, 2013

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?

graywh commented Mar 9, 2013

@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.

santosh commented Mar 9, 2013

@graywh no, just the quotes.

Contributor

I vote for leaving it the way it is: delimiter and value are different.

santosh commented Aug 19, 2015

What's up guys? 😸 @dkearns @graywh What have changed since then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment