I want to use Sublime Text as log viewer. That's why I need to create tmlanguage file for highlighting of word "ERROR" (and some others). Is there any spec of tmlanguage xml, or can you give me basic example of syntax-highlighting file for sublime text 2?
I've not found the answer in a similar question: Syntax specific highlighting with Sublime Text 2
To enable Syntax Highlighting click on “View” in the top bar, then hover your mouse over “Syntax”, and select your programming language from the list. Alternatively, if you save a document with a supported file extension, Sublime Text 3 will automatically apply the Syntax Highlighting for that language.
sublime-syntax file, then just download it and copy it to ~/. config/sublime-text-3/Packages/User . It will then be available in the syntax menu at the very bottom right of the Sublime window, either on its own (it will say "SystemVerilog") or under the User submenu, depending on your setup.
Go to the folder where sublime_text3 binary is. Go to Packages folder Open Color Scheme - Default. sublime-package Find the concern color scheme. Open it in some editor and change the values as per requirement.
🖍 Text Marker (Highlighter)This Sublime Text plugin allows temporarily and persistently marking all occurrences of selected words in a color; multiple marked selections can be added simultaneously, each marking the selections with different colors.
Sublime Text uses the same syntax highlighting as TextMate. The grammar can be found here. I'd recommend working in JSON then converting to XML, since it's easier (at least it is for me) to read. The PackageDev plugin will give you a starting snippet for defining a new syntax. It also contains some syntax highlighting for configurations, as well as a Plist to JSON converter. Below is a snippet from a protobuf syntax definition file that highlights specific words. As for the colors of the highlights, you will have to look through your color scheme file. In the below example, you would look for the scope "constant.language" for the color it uses. You probably don't need to edit the color scheme, unless you want something other than what is already built into your scheme.
{
"name": "Protocol Buffers",
"scopeName": "source.proto",
"fileTypes": ["proto"],
"patterns": [{
"match": "\\b(bool|bytes|double|fixed32|fixed64|float|int32|int64|sfixed32|sfixed64|sint32|sint64|string|uint32|uint64)\\b",
"name": "constant.language.proto"
}],
"uuid": "8c8714d5-43ef-43d2-abd9-c9088901ddd5"
}
You can play around with this app. A lot of the languages have nice definitions in them you can work from.
http://tmtheme-editor.herokuapp.com/#/Cobalt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With