Skip to content

Instantly share code, notes, and snippets.

@mattheath
Created July 1, 2013 13:54
Show Gist options
  • Save mattheath/5900971 to your computer and use it in GitHub Desktop.
Save mattheath/5900971 to your computer and use it in GitHub Desktop.
Sublime Text syntax highlight setttings for Protobuf (.proto) Source: http://johnnyjacob.wordpress.com/2012/06/08/sublime-text-syntax-definition-for-google-protocol-buffers/
{
"name": "ProtoBuf",
"scopeName": "source.proto",
"fileTypes": ["proto"],
"foldingStartMarker": "{",
"foldingStopMarker": "}",
"patterns": [
{ "match": "\\s+[0-9]*",
"name": "constant.numeric.proto",
"comment": "Field numbers"
},
{ "match": "double|float|int32|int64|uint32|uint64|sint32|sint64|long|fixed32|fixed64|sfixed|sfixed64|bool|string|bytes",
"name": "storage.type.source.proto",
"comment": "Scalar Value types."
},
{ "match": "optional|required|repeated|default",
"name": "storage.modifier.source.proto",
"comment": "Field Rules"
},
{ "match": "^message|^package|^option|^import|^extend|^service",
"name": "entity.name.function.proto",
"comment": "Message section"
},
{ "match": "\/\/.*",
"name": "comment.line.double-slash.proto",
"comment": "Comments"
}
],
"uuid": "7c5e8e41-b1b7-40e2-a140-9c0c667e1ad7"
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>proto</string>
</array>
<key>foldingStartMarker</key>
<string>{</string>
<key>foldingStopMarker</key>
<string>}</string>
<key>name</key>
<string>ProtoBuf</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>Field numbers</string>
<key>match</key>
<string>\s+[0-9]*</string>
<key>name</key>
<string>constant.numeric.proto</string>
</dict>
<dict>
<key>comment</key>
<string>Scalar Value types.</string>
<key>match</key>
<string>double|float|int32|int64|uint32|uint64|sint32|sint64|long|fixed32|fixed64|sfixed|sfixed64|bool|string|bytes</string>
<key>name</key>
<string>storage.type.source.proto</string>
</dict>
<dict>
<key>comment</key>
<string>Field Rules</string>
<key>match</key>
<string>optional|required|repeated|default</string>
<key>name</key>
<string>storage.modifier.source.proto</string>
</dict>
<dict>
<key>comment</key>
<string>Message section</string>
<key>match</key>
<string>^message|^package|^option|^import|^extend|^service</string>
<key>name</key>
<string>entity.name.function.proto</string>
</dict>
<dict>
<key>comment</key>
<string>Comments</string>
<key>match</key>
<string>//.*</string>
<key>name</key>
<string>comment.line.double-slash.proto</string>
</dict>
</array>
<key>scopeName</key>
<string>source.proto</string>
<key>uuid</key>
<string>7c5e8e41-b1b7-40e2-a140-9c0c667e1ad7</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment