Scripsit ille »Andreas Schwarz« usenet@andreas-s.net:
Ben Giddings wrote:
Martin Pirker wrote:
short question: is there somewhere a comprehensive list of Ruby
syntax-highlightning capable text editors (on Linux)?
I don’t care how “mainstream”[1] they are, it just has to be “good
enough”, small, simple, text terminal oriented… and with Ruby
support 
C’mon… try Emacs/XEmacs… You know you want to…
I’m using XEmacs for Ruby editing, but it seems that I can’t get the
syntax highlighting to work. I have installed ruby-mode, but only
comments and strings are colored. Shouldn’t there be different colors
for variables, methods, classes etc?
I’m using elvis and vim.
elvis doesn’t have ANY Ruby syntax highlighting and vim’s doesn’t work in
the case
def foo()
return if true
23
else
42
end
end
The last end isn’t colored, as if there were an end too much. Workaround:
use the ternary operator instead of if in expressions.
For vi and clones, I use this set of macros: (WARNING, contains some
special characters):
" .exrc
set shiftwidth=2
set ai
map! ,. (?)
map! , e/,.
5s
map , i,
map! ,- edd^i
map! ,+ e-$o
" additional Ruby bindings
map! ,b { |,.|
,.
}
,.e3-,
map! ,c case ,.
,.
end
,.e3-,
map! ,d do |,.|
,.
end
,.e3-,
map! ,e else
map! ,E elsif ,.
,.e1-,
map! ,i if ,.
,.
end
,.e3-,
map! ,l loop do ,.
,.
end
,.e3-,
map! ,t when ,. then ,.e^,
map! ,w while ,.
,.
end
,.e3-,
map! ,D def ,.
,.
end
,.e3-,
map! ,C class ,.
def initialize(,.)
,.
end
,.
end
,.e6-,
map! ,M module ,.
,.
end
,.e3-,
""elvis map ,r :split !ri
""elvis map ,x :split !ruby %
""vim set filetype=ruby
,. inserts a marker (I use (?) because it’s compatible even to a
normal vi [doen’t contain any non-ASCII characters]) and , jumps to
the next marker.
The above code was written using:
,Dfoo(),return ,itrue,23
,e42,-,
The return before the ,e could be optimized away, but I don’t feel like
it because I want the keywords to be inserted in the same line as I am
invoking the macro from.
···
–
The math could be slightly incorrect, but it sounds right. RFC 2795