blob: 8e6d098acd4e1e4bc6cf168e7c068818036d78fd [file] [log] [blame]
Bram Moolenaar71b6d332022-09-10 13:13:14 +01001" Vim syntax file
2" Language: git ignore
3" Maintainer: ObserverOfTime <chronobserver@disroot.org>
4" Filenames: .gitignore, *.git/info/exclude
5" Last Change: 2022 Sep 10
6
7if exists('b:current_syntax')
8 finish
9endif
10
11" Comment
12syn keyword gitignoreTodo contained TODO FIXME XXX
13syn match gitignoreComment /^#.*/ contains=gitignoreTodo
14
15" Pattern
16syn match gitignorePattern /^#\@!.*$/ contains=gitignoreNegation,gitignoreGlob,gitignoreRange,gitignoreSeparator
17syn match gitignoreNegation /^!/ contained
18syn match gitignoreGlob /\\\@1<![?*]/ contained
19syn match gitignoreRange /\\\@1<!\[.\{-}\]/ contained
20syn match gitignoreSeparator '/' contained
21
22hi def link gitignoreComment Comment
23hi def link gitignoreGlob Special
24hi def link gitignoreNegation SpecialChar
25hi def link gitignoreRange Special
26hi def link gitignoreSeparator Delimiter
27hi def link gitignoreTodo Todo
28
29let b:current_syntax = 'gitignore'