More syntax highlighting fun

Doug Kearns dougkearns at
Fri Feb 23 03:56:03 EST 2007

On Thu, Feb 22, 2007 at 11:32:36AM -0600, Tim Pope wrote:


> More important than a few cosmetic changes is the overhaul I gave to
> method, module, and class definitions.


> Try all of the following with the new syntax file: 
> def bar
> def
>   bar
> def
> def
> def
> def Foo::bar
> def
> I think this will be win-win for everyone.  We can also turn off the
> rubyFunction highlghting by default.  I'm not sure whether that's a
> better choice so I left it on for now to demonstrate what's possible.
> I also did a lot of clean-up, so let me know if you find anything that
> breaks.

>From a quick inspection I noticed that the following are not being
highlighted properly:

def foo    ; end  # whitespace after method name
def foo(x);  end  # with parameter list (also empty list)
def Foo::bar;end  # specified with ::
def [];      end  # all redefinable operator methods

Otherwise it looks great.

> Things like if/unless are in the Conditional group and
> while/until in the Loop group.

Shouldn't that be the Repeat group?

> Oh, and I had to resolve a conflict
> between Doug Kearns' and my ways of highlighting interpolated
> variables.
> Is there any reason for keeping around config options like
> ruby_no_identifiers?  I don't see what
> let ruby_no_identifiers = 1
> offers over
> hi link rubyIdentifer NONE
> Both work fine in a vimrc.  Maybe this is a holdover from the 5.x
> days?

It's really just the "Vim Way" of doing things - at least as I
understand it.  Generally the configuration options are there to allow
people to customize the highlighting without any need to understand
syntax files.  I think you'd be surprised how many people use Vim with
absolutely no understanding of these details. ;-)

More information about the vim-ruby-devel mailing list