Skip to content

Commit

Permalink
feat: Add gitignore support (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Oct 5, 2023
1 parent 7e8c50c commit 8cad363
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,9 @@
branch = master
update = none
ignore = dirty
[submodule "repos/gitignore"]
path = repos/gitignore
url = https://github.com/shunsambongi/tree-sitter-gitignore
branch = main
update = none
ignore = dirty
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Add `gitignore` support

## 0.12.56 - 2023-10-05
- Add `gitattributes` support
Expand Down
31 changes: 31 additions & 0 deletions queries/gitignore/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
(comment) @comment @spell

[
(directory_separator)
(directory_separator_escaped)
] @punctuation.delimiter

[
(wildcard_char_single)
(wildcard_chars)
(wildcard_chars_allow_slash)
(bracket_negation)
] @operator

(negation) @punctuation.special

[
(pattern_char_escaped)
(bracket_char_escaped)
] @string.escape

;; bracket expressions
[
"["
"]"
] @punctuation.bracket

(bracket_char) @constant
(bracket_range
"-" @operator)
(bracket_char_class) @constant.builtin
1 change: 1 addition & 0 deletions repos/gitignore
Submodule gitignore added at f4685b
1 change: 1 addition & 0 deletions tree-sitter-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ See `tree-sitter-langs-repos'."
(fortran-mode . fortran)
(gdscript-mode . gdscript)
(gitattributes-mode . gitattributes)
(gitignore-mode . gitignore)
(go-mode . go)
(haskell-mode . haskell)
(hcl-mode . hcl)
Expand Down

0 comments on commit 8cad363

Please sign in to comment.