Skip to content

Commit 8cad363

Browse files
authored
feat: Add gitignore support (#260)
1 parent 7e8c50c commit 8cad363

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,9 @@
424424
branch = master
425425
update = none
426426
ignore = dirty
427+
[submodule "repos/gitignore"]
428+
path = repos/gitignore
429+
url = https://github.com/shunsambongi/tree-sitter-gitignore
430+
branch = main
431+
update = none
432+
ignore = dirty

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Unreleased
4+
- Add `gitignore` support
45

56
## 0.12.56 - 2023-10-05
67
- Add `gitattributes` support

queries/gitignore/highlights.scm

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(comment) @comment @spell
2+
3+
[
4+
(directory_separator)
5+
(directory_separator_escaped)
6+
] @punctuation.delimiter
7+
8+
[
9+
(wildcard_char_single)
10+
(wildcard_chars)
11+
(wildcard_chars_allow_slash)
12+
(bracket_negation)
13+
] @operator
14+
15+
(negation) @punctuation.special
16+
17+
[
18+
(pattern_char_escaped)
19+
(bracket_char_escaped)
20+
] @string.escape
21+
22+
;; bracket expressions
23+
[
24+
"["
25+
"]"
26+
] @punctuation.bracket
27+
28+
(bracket_char) @constant
29+
(bracket_range
30+
"-" @operator)
31+
(bracket_char_class) @constant.builtin

repos/gitignore

Submodule gitignore added at f4685bf

tree-sitter-langs.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ See `tree-sitter-langs-repos'."
127127
(fortran-mode . fortran)
128128
(gdscript-mode . gdscript)
129129
(gitattributes-mode . gitattributes)
130+
(gitignore-mode . gitignore)
130131
(go-mode . go)
131132
(haskell-mode . haskell)
132133
(hcl-mode . hcl)

0 commit comments

Comments
 (0)