Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add an edit mode to jEdit?

While looking for a light-weight Scala development environment, I came upon an Scala edit mode for jEdit. I don't know how to put it to use, though. How does one put a new edit mode in jEdit?

like image 693
Daniel C. Sobral Avatar asked Jan 09 '09 13:01

Daniel C. Sobral


1 Answers

All of this can be found inside jEdit's help, Using jEdit -> Writing Edit Modes -> Installing Edit Modes. But, if you are like me, and tried StackOverflow first, here's the short of it.

Place the mode file (in this case, scala.xml) inside the "modes" directory in jEdit home directory -- this can be found through the Utilities menu -- if you want it for all users, or the "modes" directory in user's jEdit's settings diretory -- which can also be found through the Utilities menu -- if the new mode is to be used by only one user.

After that, edit a file "catalog" inside that same directory. It contains a list of supported modes. If you are working on the settings directory, there won't be any examples to use as a reference, but the catalog inside the home directory has plenty.

A settings directory catalog would look like this, for the referenced mode:

<?xml version="1.0"?>
<!DOCTYPE MODES SYSTEM "catalog.dtd">

<MODES>

<!-- Add lines like the following, one for each edit mode you add: -->
<!-- <MODE NAME="foo" FILE="foo.xml" FILE_NAME_GLOB="*.foo" /> -->

<MODE NAME="scala"      FILE="scala.xml"
                FILE_NAME_GLOB="*.scala" />

</MODES>
like image 77
Daniel C. Sobral Avatar answered Sep 20 '22 22:09

Daniel C. Sobral