Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit Textmate syntax highlighting?

Tags:

textmate

I have recently begun working with Objective-C in Textmate and noticed that the syntax highlighting is rather poor (a comment is the exact same color as a variable declaration). I've never done syntax highlighting changes in Textmate and I'm having trouble figuring out how to correctly modify it. For example the scope of a comment in an Objective-c file is: source.objc.iphone meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc

but changing the colors on that changes alot more than just comments.

Does anyone know of a good place to start learning how to do this?

like image 425
James P. Wright Avatar asked Aug 05 '09 03:08

James P. Wright


People also ask

How do I change the highlighting syntax?

You can change (or apply) syntax highlighting for the active file by using the View as language drop down in the Formatting group of the Coding tab, or the syntax highlighting selector in the Status bar.

What is syntax highlighting text editor?

Syntax highlighting is a feature of text editors that are used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of terms.


1 Answers

You can check the scope of your current cursor with ^ + Shift + P or Bundles > Bundle Development > Show Scode. After you know the scope, you can create / change the color of it. If the comment is not detected by the language grammar, you have to extend it. See the documentation for further information: http://manual.macromates.com/en/language_grammars#language_grammars

like image 53
Martin Wittemann Avatar answered Oct 19 '22 14:10

Martin Wittemann