Skip to content

Commit 7f63c07

Browse files
committed
feat(queries:git-config): inject bash in some fields
1 parent 066dded commit 7f63c07

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

runtime/queries/git-config/injections.scm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,22 @@
1313
(name) @_var (#any-of? @_var "xfuncname" "wordRegex")
1414
value: (string) @injection.content
1515
(#set! injection.language "regex"))
16+
17+
((section_header (section_name) @markup.heading)
18+
(#eq? @markup.heading "alias")
19+
(variable (name)
20+
value: (string) @injection.content
21+
; ASK: some way to not highlight the bang as `sh`?
22+
; ASK: add `(?s)` (dot-all) flag?
23+
(#match? @injection.content "(^\"!.*\"$)|(^!)")
24+
(#set! injection.language "bash"))
25+
)
26+
27+
(variable
28+
; ASK: is this overly general?
29+
(name) @_var (#eq? @_var "helper")
30+
value: (string) @injection.content
31+
(#match? @injection.content "(^\"!.*\"$)|(^!)")
32+
(#set! injection.language "bash"))
33+
34+
; TODO: missing `*.cmd` sections

0 commit comments

Comments
 (0)