Permalink
Browse files

Add support for git config files.

The grammar does not recognize integers, value pairs without a value (short for setting the value to true) nor multi-line values (created by ending a line with a backslash).
  • Loading branch information...
sorbits committed Dec 1, 2008
1 parent 69557aa commit 8a5121664146c49064caa4f638e494b3a9eb58ea
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>name</key>
+ <string>Comments: Git Config</string>
+ <key>scope</key>
+ <string>source.git-config</string>
+ <key>settings</key>
+ <dict>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TM_COMMENT_START</string>
+ <key>value</key>
+ <string># </string>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>TM_COMMENT_START_2</string>
+ <key>value</key>
+ <string>; </string>
+ </dict>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>1E1882B3-9578-427F-9EF8-3C56EF407F13</string>
+</dict>
+</plist>
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>name</key>
+ <string>Symbol Popup: Git Config Subsection</string>
+ <key>scope</key>
+ <string>entity.name.section.subsection.git-config - punctuation.definition.section.subsection</string>
+ <key>settings</key>
+ <dict>
+ <key>showInSymbolList</key>
+ <integer>1</integer>
+ <key>symbolTransformation</key>
+ <string>
+ s/^/ /; # indent subsections
+ </string>
+ </dict>
+ <key>uuid</key>
+ <string>E6D2DCFE-A40D-4BF1-9B43-7E3199CF00B4</string>
+</dict>
+</plist>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>name</key>
+ <string>Symbol Popup: Git Config Section</string>
+ <key>scope</key>
+ <string>entity.name.section.git-config</string>
+ <key>settings</key>
+ <dict>
+ <key>showInSymbolList</key>
+ <integer>1</integer>
+ </dict>
+ <key>uuid</key>
+ <string>3E646038-6F79-46BE-96A3-9802E7011162</string>
+</dict>
+</plist>
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>fileTypes</key>
+ <array>
+ <string>.git/config</string>
+ <string>.gitconfig</string>
+ <string>etc/gitconfig</string>
+ </array>
+ <key>name</key>
+ <string>Git Config</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#section</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#comment</string>
+ </dict>
+ </array>
+ <key>repository</key>
+ <dict>
+ <key>boolean</key>
+ <dict>
+ <key>match</key>
+ <string>\b(?i:yes|no|0|1|true|false)\b</string>
+ <key>name</key>
+ <string>constant.language.boolean.git-config</string>
+ </dict>
+ <key>comment</key>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>comment.line.number-sign.git-config</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.git-config</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>comment.line.semi-colon.git-config</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.git-config</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>((#).*$\n?)|((;).*$\n?)</string>
+ </dict>
+ <key>section</key>
+ <dict>
+ <key>begin</key>
+ <string>\[\s*([\w_-]+)(?:\s+((")(?:[^"\\]|\\["\\])*("))|\.([\w_-]+))?\s*\]</string>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.section.git-config</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.section.subsection.git-config</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.section.subsection.begin.git-config</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.section.subsection.end.git-config</string>
+ </dict>
+ <key>5</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.section.subsection.git-config</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(?=\[)</string>
+ <key>name</key>
+ <string>meta.section.git-config</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#value_pair</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#comment</string>
+ </dict>
+ </array>
+ </dict>
+ <key>string</key>
+ <dict>
+ <key>begin</key>
+ <string>"</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.string.begin.git-config</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>"</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.string.end.git-config</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>string.quoted.double.git-config</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>match</key>
+ <string>\\[ntb"\\]</string>
+ <key>name</key>
+ <string>constant.character.escape.git-config</string>
+ </dict>
+ <dict>
+ <key>match</key>
+ <string>\\.</string>
+ <key>name</key>
+ <string>invalid.illegal.unknown-escape.git-config</string>
+ </dict>
+ </array>
+ </dict>
+ <key>value_pair</key>
+ <dict>
+ <key>begin</key>
+ <string>(\w+)\s*(=)\s*(?!$)</string>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>support.constant.git-config</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.separator.key-value.git-config</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>$|(?=[#;])</string>
+ <key>name</key>
+ <string>meta.value-pair.section-item.git-config</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#boolean</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#string</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#comment</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>scopeName</key>
+ <string>source.git-config</string>
+ <key>uuid</key>
+ <string>F0EFAC75-4357-45BD-AB08-682DAF8C6FBF</string>
+</dict>
+</plist>
View
@@ -104,12 +104,15 @@
<string>E56D4990-B615-4788-A46C-5D0CDE750D56</string>
<string>E9180CC9-BA7D-4271-A0A4-0263D8A71F46</string>
<string>BFE83C06-8508-44BE-A975-95A57BF619A7</string>
+ <string>F0EFAC75-4357-45BD-AB08-682DAF8C6FBF</string>
+ <string>1E1882B3-9578-427F-9EF8-3C56EF407F13</string>
+ <string>3E646038-6F79-46BE-96A3-9802E7011162</string>
+ <string>E6D2DCFE-A40D-4BF1-9B43-7E3199CF00B4</string>
<string>7CE2C842-EBC4-443C-8DDB-3B16AC593D9A</string>
<string>9EAEC1C1-9979-4DB8-9877-A619580412AA</string>
<string>20F5C491-F71C-4963-9C61-DF7294976550</string>
<string>D0DF4B19-F311-48CC-BF68-F8B33CD051D3</string>
<string>1FF5FF82-13A0-4C83-BAD6-D67AE8180FA9</string>
- <string>B7AA1DCF-232E-45E2-B1A2-C2488E98FC59</string>
<string>246BC5D6-F4DC-458B-8966-C601B65AA1E9</string>
<string>6494E41A-04CE-4D30-BD9A-B50056A7C13F</string>
<string>3F84F9EB-027A-4200-B29B-C99EFA09F453</string>
@@ -121,6 +124,8 @@
<string>556EF65D-C59B-4A15-BA4A-D5D87C2695A0</string>
<string>3F77F0FC-F476-4B83-92D1-77D854A9D64D</string>
<string>794C7EF9-B0A5-4B27-90BD-000837237B85</string>
+ <string>1D25F132-718E-4B97-95CC-724AAC35E46C</string>
+ <string>1C12DE42-78A9-4DCA-BB55-2B8E6328C72D</string>
</array>
<key>uuid</key>
<string>EADD4718-EE11-4ABF-A7E6-13351FB3799D</string>

0 comments on commit 8a51216

Please sign in to comment.