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 2e02a1d commit efc0ebb
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 @@ -190,3 +190,7 @@
path = helix-syntax/languages/tree-sitter-git-rebase
url = https://github.com/the-mikedavis/tree-sitter-git-rebase.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 @@ -530,3 +530,12 @@ file-types = ["git-rebase-todo"]
injection-regex = "git-rebase"
comment-token = "#"
indent = { tab-width = 2, unit = " " }

[[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 efc0ebb

Please sign in to comment.