Skip to content

Commit efc0ebb

Browse files
committed
add tree-sitter-git-config
1 parent 2e02a1d commit efc0ebb

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,7 @@
190190
path = helix-syntax/languages/tree-sitter-git-rebase
191191
url = https://github.com/the-mikedavis/tree-sitter-git-rebase.git
192192
shallow = true
193+
[submodule "helix-syntax/languages/tree-sitter-git-config"]
194+
path = helix-syntax/languages/tree-sitter-git-config
195+
url = https://github.com/the-mikedavis/tree-sitter-git-config.git
196+
shallow = true

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
| elixir || | | `elixir-ls` |
1313
| fish |||| |
1414
| git-commit || | | |
15+
| git-config || | | |
1516
| git-diff || | | |
1617
| git-rebase || | | |
1718
| glsl || || |

languages.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,12 @@ file-types = ["git-rebase-todo"]
530530
injection-regex = "git-rebase"
531531
comment-token = "#"
532532
indent = { tab-width = 2, unit = " " }
533+
534+
[[language]]
535+
name = "git-config"
536+
scope = "source.gitconfig"
537+
roots = []
538+
file-types = [".gitmodules", ".gitconfig"]
539+
injection-regex = "git-config"
540+
comment-token = "#"
541+
indent = { tab-width = 4, unit = "\t" }
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
((section_name) @keyword.directive
2+
(#eq? @keyword.directive "include"))
3+
4+
((section_header
5+
(section_name) @keyword.directive
6+
(subsection_name))
7+
(#eq? @keyword.directive "includeIf"))
8+
9+
(section_name) @markup.heading
10+
(variable (name) @variable.other.member)
11+
[(true) (false)] @constant.builtin.boolean
12+
(integer) @constant.numeric.integer
13+
14+
((string) @string.special.path
15+
(#match? @string.special.path "^(~|./|/)"))
16+
17+
[(string) (subsection_name)] @string
18+
19+
[
20+
"["
21+
"]"
22+
"\""
23+
] @punctuation.bracket
24+
25+
"=" @punctuation.delimiter
26+
27+
(comment) @comment

0 commit comments

Comments
 (0)