]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/git-rebase-todo.yaml
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / syntax / git-rebase-todo.yaml
index 30ede72a48ac176145b317d7738308f3677bbde0..e2dd588a3d92cf727f182e1787e40bc5f4633f75 100644 (file)
@@ -1,28 +1,19 @@
 filetype: git-rebase-todo
 
 detect:
-    filename: "git-rebase-todo"
+    filename: "^(.*[\\/])?git\\-rebase\\-todo$"
 
 rules:
+    # Rebase commands
+    - statement: "^(p(ick)?|r(eword)?|e(dit)?|s(quash)?|f(ixup)?|x|exec|d(rop)?)\\b"
+    # Commit IDs
+    - identifier: "\\b([0-9a-f]{7,40})\\b"
+
+    # Color keywords for Github (and others)
+    - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b"
+
     # Comments
-    - comment:
-        start: "#"
+    - comment.line:
+        start: "^#"
         end: "$"
         rules: []
-    # Rebase commands
-    - statement: "^(e|edit) [0-9a-f]{7,40}"
-    - statement: "^#  (e, edit)"
-    - statement: "^(f|fixup) [0-9a-f]{7,40}"
-    - statement: "^#  (f, fixup)"
-    - statement: "^(p|pick) [0-9a-f]{7,40}"
-    - statement: "^#  (p, pick)"
-    - statement: "^(r|reword) [0-9a-f]{7,40}"
-    - statement: "^#  (r, reword)"
-    - statement: "^(s|squash) [0-9a-f]{7,40}"
-    - statement: "^#  (s, squash)"
-    - statement: "^(x|exec) [^ ]+ [0-9a-f]{7,40}"
-    - statement: "^#  (x, exec)"
-    # Recolor hash symbols
-    - special: "#"
-    # Commit IDs
-    - identifier: "[0-9a-f]{7,40}"