How to change the default syntax by adding a new keyword in Sublime Text 2?

I hope the Sublime Text 2 syntax highlighting system will support new C ++ 11 keywords like constexpr .

However, I did not understand how to achieve it, can anyone help?

+4
source share
2 answers

Edit this file:

~/Library/Application Support/Sublime Text 2/Packages/C++/C.tmLanguage

Go to approx. line 55 and add constexpr to the list

  <dict> <key>match</key> <string>\b(const|extern|register|restrict|static|volatile|inline)\b</string> <key>name</key> <string>storage.modifier.c</string> </dict> 
+4
source

I know this is a Sublime Text 2 question, but when I tried to use this for Sublime Text 3, I came across this post, so I thought I mentioned that Sublime Text 3 has its own system (docs here and here ), and as lthreed mentioned to this question by you, you can use the PackageResourceViewer package to view the source text of Sublime Text biased syntax expressions (and then copy / paste them into your own syntax for editing).

0
source

All Articles