如何向 jEdit 添加编辑模式?

发布于 2024-07-12 01:10:28 字数 178 浏览 5 评论 0原文

在寻找轻量级 Scala 开发环境时,我遇到了 Scala 编辑jEdit 模式。 但我不知道如何使用它。 如何在 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不再让梦枯萎 2024-07-19 01:10:28

所有这些都可以在 jEdit 的帮助中找到,Using jEdit -> 写入编辑模式 -> 安装编辑模式。 但是,如果您像我一样,首先尝试过 StackOverflow,那么这就是它的缺点。

将模式文件(在本例中为 scala.xml)放在 jEdit 主目录中的“modes”目录中(可以通过“实用程序”菜单找到),如果您希望所有用户都使用它,或者将其放在 jEdit 主目录中的“modes”目录中如果新模式仅由一个用户使用,则用户的 jEdit 设置目录(也可以通过“实用程序”菜单找到)。

之后,在同一目录中编辑文件“catalog”。 它包含支持的模式列表。 如果您正在处理设置目录,则不会有任何示例可供参考,但主目录内的目录有很多。

对于引用模式,设置目录目录如下所示:

<?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>

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>
只有一腔孤勇 2024-07-19 01:10:28

您可以将 scala.xml 文件复制到 $JEDIT_HOME/modes

You can copy the scala.xml file to $JEDIT_HOME/modes

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文