结合不同 Eclipse 编辑器的语法高亮显示
我使用 Eclipse、StatET 和 Sweave 插件来编写 R 和 Latex 代码。最酷的事情是 R 和 Latex 代码可以放在一个文件中,但是最终会遇到语法突出显示问题。
我有大量 R 代码,并且非常喜欢 Eclipse R 语法突出显示。但现在将 R 和 Latex 结合起来意味着我必须使用 .Rnw 文件,其中没有针对 R 的特定语法突出显示
。首选项->内容类型 我可以将 *.Rnw 添加到“R 脚本文件”,这使得 Eclipse 使用标准 R 编辑器打开 .Rnw 文件。然而,这意味着我不再有 Sweave 的语法突出显示。此外,Sweave 代码在 R 编辑器中显示为错误。
我的问题是是否可以以简单的方式组合不同的语法突出显示样式?
I use Eclipse, StatET and the Sweave plugin to write my R and Latex code. The cool thing is that R and Latex code can be put together into one file, however you end up with a syntax highlighting problem.
I have loads of R code and I very much like the Eclipse R syntax highlighting. But now combining R and Latex means that I have to work with .Rnw files where there is no particular syntax highlighting for R.
When I go to Eclipse -> Preferences -> Content Types I can add *.Rnw to "R script file" which makes Eclipse to open the .Rnw files with the standard R Editor. However, this means that I do not have syntax highlighting for Sweave any longer. In addition, the Sweave code is shown as an error in the R editor.
My question is whether it is possible to combine different syntax highlighting styles in an easy way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有任何 Eclipse 插件/编辑器真正支持在一个编辑器中混合多种语法。无论如何,Eclipse 平台目前不支持它。
不过,您可以尝试 Eclipse Colorer 插件。它允许切换当前编辑器的着色样式。它可能不支持 R 和 Latex 语法,但您可以通过添加自己的 来创建自己的突出显示HRC 文件。
I don't think any Eclipse plugins/editors really support mixing up several syntaxes inside one editor. At any rate it is not currently supported in Eclipse Platform.
However you can try Eclipse Colorer plugin. It allows to switch coloring style for the current editor. It may mot support both R and Latex syntax, but you can create your own highlighting by adding your own HRC file.