B Seven
B Seven

Reputation: 45941

How to add a command for syntax highlighting in Sublime Text 2?

Sublime Text 2 does not highlight require_relative, but does highlight require.

How to add require_relative to the list of words for syntax highlighting for Ruby?

Upvotes: 2

Views: 859

Answers (2)

Zach Kemp
Zach Kemp

Reputation: 11904

In Ruby.tmLanguage, Change this line:

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

Upvotes: 4

Egryan
Egryan

Reputation: 717

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

Upvotes: 1

Related Questions