"Improved ruby mode for JEdit"

April 02, 2009

My post about Textmate to JEdit theme converter included example screenshots of JEdit running with some converted themes. However I’m using a little tweaked ruby highlighting mode which recognizes method, class and module names. It shows those names using styling defined for FUNCTION type entities (not all JEdit themes include styling for it but themes converted with tm2jed use it).

If you want to have highlighting for method names in your ruby code put following xml code into first RULES block in your ruby.xml file:

<!-- method, class and modules names -->
<MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1">def </MARK_FOLLOWING>
<MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1">class </MARK_FOLLOWING>
<MARK_FOLLOWING TYPE="FUNCTION" MATCH_TYPE="KEYWORD1">module </MARK_FOLLOWING>

Or just get mine ruby.xml file, put it into your .jedit/modes directory and add this to .jedit/modes/catalog file:

<MODE NAME="ruby" FILE="ruby.xml" FILE_NAME_GLOB="*.rb" />
Read more about jedit, ruby, themes.
blog comments powered by Disqus