]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/git-commit.yaml
Merge pull request #1412 from tommyshem/batSyntaxHighlighting
[micro.git] / runtime / syntax / git-commit.yaml
index 40b46acd0461faaa11e07e7a003a4a2ebf613fb0..3429edd2c39e0bcd930d84d6379a9723d5fd894e 100644 (file)
@@ -1,30 +1,25 @@
 filetype: git-commit
 
 detect:
-    filename: "COMMIT_EDITMSG|TAG_EDITMSG"
+    filename: "^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG)$"
 
 rules:
-    # Commit message
-    - ignore: ".*"
+    # File changes
+    - type.keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
+    - type.keyword: "#[[:space:]]deleted:"
+    - type.keyword: "#[[:space:]]modified:"
+    - type.keyword: "#[[:space:]]new file:"
+    - type.keyword: "#[[:space:]]renamed:"
+    - type.keyword: "^#[[:space:]]Changes.*[:]"
+    - type.keyword: "^#[[:space:]]Your branch and '[^']+"
+    - type.keyword: "^#[[:space:]]Your branch and '"
+    - type.keyword: "^#[[:space:]]On branch [^ ]+"
+    - type.keyword: "^#[[:space:]]On branch"
+    # Color keywords for closing issues (such as on Github)
+    - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b"
+
     # Comments
-    - comment:
-        start: "#"
+    - comment.line:
+        start: "^#"
         end: "$"
         rules: []
-    # File changes
-    - keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*"
-    - keyword: "#[[:space:]]deleted:"
-    - keyword: "#[[:space:]]modified:"
-    - keyword: "#[[:space:]]new file:"
-    - keyword: "#[[:space:]]renamed:"
-    # Untracked filenames
-    - error: "^#       [^/?*:;{}\\\\]+\\.[^/?*:;{}\\\\]+$"
-    - keyword: "^#[[:space:]]Changes.*[:]"
-    - keyword: "^#[[:space:]]Your branch and '[^']+"
-    - keyword: "^#[[:space:]]Your branch and '"
-    - keyword: "^#[[:space:]]On branch [^ ]+"
-    - keyword: "^#[[:space:]]On branch"
-    # Recolor hash symbols
-    - special: "#"
-    # Trailing spaces (+LINT is not ok, git uses tabs)
-    - error: "[[:space:]]+$"