robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Jan Edmund LazoMerge pull request #13348 from adrian5/filetype-gitconfigee8f530b40

master
1.6 KiB36 linesraw
1" Vim syntax file
2" Language:	git config file
3" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
4" Filenames:	gitconfig, .gitconfig, *.git/config
5" Last Change:	2019 Dec 05
6
7if exists("b:current_syntax")
8  finish
9endif
10
11syn case ignore
12syn sync minlines=10
13
14syn match   gitconfigComment	"[#;].*" contains=@Spell
15syn match   gitconfigSection	"\%(^\s*\)\@<=\[[a-z0-9.-]\+\]"
16syn match   gitconfigSection	'\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]'
17syn match   gitconfigVariable	"\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
18syn region  gitconfigAssignment  matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend
19syn keyword gitconfigBoolean true false yes no contained
20syn match   gitconfigNumber  "\<\d\+\>" contained
21syn region  gitconfigString  matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError
22syn match   gitconfigError  +\\.+	 contained
23syn match   gitconfigEscape +\\[\\"ntb]+ contained
24syn match   gitconfigEscape +\\$+	 contained
25
26hi def link gitconfigComment		Comment
27hi def link gitconfigSection		Keyword
28hi def link gitconfigVariable		Identifier
29hi def link gitconfigBoolean		Boolean
30hi def link gitconfigNumber		Number
31hi def link gitconfigString		String
32hi def link gitconfigDelim		Delimiter
33hi def link gitconfigEscape		Special
34hi def link gitconfigError		Error
35
36let b:current_syntax = "gitconfig"