1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-22 17:55:10 +01:00
vim/runtime/syntax/gitconfig.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.6 KiB
VimL
Raw Permalink Normal View History

2008-06-24 22:14:38 +00:00
" Vim syntax file
" Language: git config file
2010-01-06 20:54:52 +01:00
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
2008-06-24 22:14:38 +00:00
" Filenames: gitconfig, .gitconfig, *.git/config
2019-12-05 22:47:25 +01:00
" Last Change: 2019 Dec 05
2008-06-24 22:14:38 +00:00
if exists("b:current_syntax")
2010-05-21 12:05:36 +02:00
finish
2008-06-24 22:14:38 +00:00
endif
syn case ignore
syn sync minlines=10
2019-09-27 19:34:08 +02:00
syn match gitconfigComment "[#;].*" contains=@Spell
2008-06-24 22:14:38 +00:00
syn match gitconfigSection "\%(^\s*\)\@<=\[[a-z0-9.-]\+\]"
syn match gitconfigSection '\%(^\s*\)\@<=\[[a-z0-9.-]\+ \+\"\%([^\\"]\|\\.\)*"\]'
2019-12-05 22:47:25 +01:00
syn match gitconfigVariable "\%(^\s*\)\@<=\a[a-z0-9-]*\%(\s*\%([=#;]\|$\)\)\@=" nextgroup=gitconfigAssignment skipwhite
2008-06-24 22:14:38 +00:00
syn region gitconfigAssignment matchgroup=gitconfigNone start=+=\s*+ skip=+\\+ end=+\s*$+ contained contains=gitconfigBoolean,gitconfigNumber,gitConfigString,gitConfigEscape,gitConfigError,gitconfigComment keepend
syn keyword gitconfigBoolean true false yes no contained
2019-12-05 22:47:25 +01:00
syn match gitconfigNumber "\<\d\+\>" contained
2008-06-24 22:14:38 +00:00
syn region gitconfigString matchgroup=gitconfigDelim start=+"+ skip=+\\+ end=+"+ matchgroup=gitconfigError end=+[^\\"]\%#\@!$+ contained contains=gitconfigEscape,gitconfigEscapeError
syn match gitconfigError +\\.+ contained
syn match gitconfigEscape +\\[\\"ntb]+ contained
syn match gitconfigEscape +\\$+ contained
hi def link gitconfigComment Comment
hi def link gitconfigSection Keyword
hi def link gitconfigVariable Identifier
hi def link gitconfigBoolean Boolean
hi def link gitconfigNumber Number
hi def link gitconfigString String
hi def link gitconfigDelim Delimiter
2019-12-05 22:47:25 +01:00
hi def link gitconfigEscape Special
2008-06-24 22:14:38 +00:00
hi def link gitconfigError Error
let b:current_syntax = "gitconfig"