Sublime Text 2 does not highlight require_relative
, but does highlight require
.
Sublime Text 2不突出显示require_relative,但突出显示require。
How to add require_relative
to the list of words for syntax highlighting for Ruby?
如何将require_relative添加到单词列表中以进行Ruby的语法高亮显示?
2 个解决方案
#1
4
In Ruby.tmLanguage, Change this line:
在Ruby.tmLanguage中,更改此行:
<string>\b(require|gem)\b</string>
to
至
<string>\b(require|gem|require_relative)\b</string>
The Ruby.tmLanguage file can be found from within Sublime Text 2 with Sublime Text > Preferences > Browse Packages
.
Ruby.tmLanguage文件可以在Sublime Text 2中使用Sublime Text> Preferences> Browse Packages找到。
#2
1
You will need to edit the Ruby tmLanguage file. This should be located in your "sublime install directory"/Data/Packages/Ruby. The format maybe a little strange but sublime text docs gives you instructions on how to edit the tmLanguages files here http://docs.sublimetext.info/en/latest/reference/syntaxdefs.html
您需要编辑Ruby tmLanguage文件。这应该位于您的“sublime安装目录”/ Data / Packages / Ruby中。格式可能有点奇怪,但是崇高的文本文档为您提供了如何编辑tmLanguages文件的说明http://docs.sublimetext.info/en/latest/reference/syntaxdefs.html
#1
4
In Ruby.tmLanguage, Change this line:
在Ruby.tmLanguage中,更改此行:
<string>\b(require|gem)\b</string>
to
至
<string>\b(require|gem|require_relative)\b</string>
The Ruby.tmLanguage file can be found from within Sublime Text 2 with Sublime Text > Preferences > Browse Packages
.
Ruby.tmLanguage文件可以在Sublime Text 2中使用Sublime Text> Preferences> Browse Packages找到。
#2
1
You will need to edit the Ruby tmLanguage file. This should be located in your "sublime install directory"/Data/Packages/Ruby. The format maybe a little strange but sublime text docs gives you instructions on how to edit the tmLanguages files here http://docs.sublimetext.info/en/latest/reference/syntaxdefs.html
您需要编辑Ruby tmLanguage文件。这应该位于您的“sublime安装目录”/ Data / Packages / Ruby中。格式可能有点奇怪,但是崇高的文本文档为您提供了如何编辑tmLanguages文件的说明http://docs.sublimetext.info/en/latest/reference/syntaxdefs.html