VIM syntax coloring files for Ruby

H

Henry T. So Jr.

I have noticed that VIM cannot properly color the following construct
in Ruby:

module MyModule
def my_method
foo = [ [ 1, 2 ], [3, 4], [5, 6] ]
until foo.empty?
foo.shift.each do |element|
puts element
end # colored to match until
end # colored to match def
end # colored to match module
end # not colorized

In the syntax/ruby.vim file, the line after the comment "statement with
optional *do*", the statements here exclude rubyDoBlocks and
rubyCurlyBlocks from containment. I'm not entirely sure why it was set
up this way. If I change the ruby.vim file to remove this exclusion, it
still can't properly handle this construct:

module MyModule
def my_method
foo = [ [ 1, 2 ], [3, 4], [5, 6] ]
until foo.empty? do
foo.shift.each do |element|
puts element
end
end
end
end

Does anyone familiar with vim syntax files have any idea how to properly
correct this?

Regards,
Henry
 
D

Doug Kearns

I have noticed that VIM cannot properly color the following construct
in Ruby:

In the syntax/ruby.vim file, the line after the comment "statement with
optional *do*", the statements here exclude rubyDoBlocks and
rubyCurlyBlocks from containment.

This sounds like quite an old version of ruby.vim. You can find the
latest here: http://vim-ruby.rubyforge.org/

Regards,
Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top