Skip to content

Commit

Permalink
add tree-sitter-git-config
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Jan 6, 2022
1 parent a8fd33a commit dcac147
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,7 @@
path = helix-syntax/languages/tree-sitter-regex
url = https://github.com/tree-sitter/tree-sitter-regex.git
shallow = true
[submodule "helix-syntax/languages/tree-sitter-git-config"]
path = helix-syntax/languages/tree-sitter-git-config
url = https://github.com/the-mikedavis/tree-sitter-git-config.git
shallow = true
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| elixir || | | `elixir-ls` |
| fish |||| |
| git-commit || | | |
| git-config || | | |
| git-diff || | | |
| git-rebase || | | |
| glsl || || |
Expand Down
1 change: 1 addition & 0 deletions helix-syntax/languages/tree-sitter-git-config
Submodule tree-sitter-git-config added at 0e4f0b
9 changes: 9 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,12 @@ scope = "source.regex"
injection-regex = "regex"
file-types = ["regex"]
roots = []

[[language]]
name = "git-config"
scope = "source.gitconfig"
roots = []
file-types = [".gitmodules", ".gitconfig"]
injection-regex = "git-config"
comment-token = "#"
indent = { tab-width = 4, unit = "\t" }
27 changes: 27 additions & 0 deletions runtime/queries/git-config/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
((section_name) @keyword.directive
(#eq? @keyword.directive "include"))

((section_header
(section_name) @keyword.directive
(subsection_name))
(#eq? @keyword.directive "includeIf"))

(section_name) @markup.heading
(variable (name) @variable.other.member)
[(true) (false)] @constant.builtin.boolean
(integer) @constant.numeric.integer

((string) @string.special.path
(#match? @string.special.path "^(~|./|/)"))

[(string) (subsection_name)] @string

[
"["
"]"
"\""
] @punctuation.bracket

"=" @punctuation.delimiter

(comment) @comment

0 comments on commit dcac147

Please sign in to comment.