Adding syntax highlighting to programming language

2019-01-17 15:30发布

问题:

Does anyone know if it's possible to add custom syntax highlighting to Xcode 4?

In Xcode 3 you just had to add some files in:

~/Library/Application Support/Developer/Shared/Xcode/Specifications/

but that does not seem to work anymore?

回答1:

XCode syntax coloring for lua https://github.com/bastos/lua-xcode-coloring



回答2:

I haven't tried that, but I think it's worth trying the following (at least on XCode 4.3):

1 - Go to /Contents/OtherFrameworks/DevToolsCore.framework/Versions/A/Resources/ inside the XCode package;

2 - Find the files "Built-in file types.pbfilespec" and "Standard file types.pbfilespec";

3 - Create backup copies of those files;

4 - The language syntax should be inserted in the file "Built-in file types.pbfilespec". Just take the definition of C language, for instance, as a template and define the new language syntax;

5 - The file "Standard file types.pbfilespec" seems to make reference to the file "Built-in file types.pbfilespec", but that's just a guess. If step 4 is not enough, consider editing this file too;

Hope it helps.



回答3:

Version 4 uses .dvtcolortheme files and they should be placed into ~/Library/Developer/Xcode/UserData/FontAndColorThemes

Solarized has a nice and small tutorial: https://github.com/brianmichel/solarized/tree/master/apple-xcode4-solarized