robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
ab20681c52
master
1" Vim syntax file 2" Language: git attributes 3" Maintainer: ObserverOfTime <chronobserver@disroot.org> 4" Filenames: .gitattributes, *.git/info/attributes 5" Last Change: 2022 Sep 09 6 7if exists ( 'b:current_syntax' ) 8finish 9endif 10 11let s: cpo_save = & cpoptions 12set cpoptions & vim 13 14" Comment 15syn keyword gitattributesTodo contained TODO FIXME XXX 16syn match gitattributesComment /^\s * #. * /contains = gitattributesTodo 17 18" Pattern 19syn match gitattributesPattern /^\s * #\@!\(".\+"\|\S\+\) /skipwhite 20 \nextgroup = gitattributesAttrPrefixed , gitattributesAttrAssigned skipwhite 21 \contains = gitattributesGlob , gitattributesRange , gitattributesSeparator 22syn match gitattributesGlob /\\\@1<! [ ?* ] /contained 23syn match gitattributesRange /\\\@1<!\[.\{-}\] /contained 24syn match gitattributesSeparator '/ 'contained 25 26" Attribute 27syn match gitattributesAttrPrefixed /[ !- ] \? [ A-Za-z0-9_. ][ -A-Za-z0-9_. ] * / 28 \transparent contained skipwhite 29 \nextgroup = gitattributesAttrPrefixed , gitattributesAttrAssigned 30 \contains = gitattributesPrefix , gitattributesName 31syn match gitattributesAttrAssigned /[ A-Za-z0-9_. ][ -A-Za-z0-9_. ] * =\S\+ / 32 \transparent contained skipwhite 33 \nextgroup = gitattributesAttrPrefixed , gitattributesAttrAssigned 34 \contains = gitattributesName , gitattributesAssign , gitattributesBoolean , gitattributesString 35syn match gitattributesName /[ A-Za-z0-9_. ][ -A-Za-z0-9_. ] * / 36 \contained nextgroup = gitattributesAssign 37syn match gitattributesPrefix /[ !- ] /contained 38 \nextgroup = gitAttributesName 39syn match gitattributesAssign '= 'contained 40 \nextgroup = gitattributesBoolean , gitattributesString 41syn match gitattributesString /=\@1<=\S\+ /contained 42syn keyword gitattributesBoolean true false contained 43 44" Macro 45syn match gitattributesMacro /^\s * \[attr\]\s * \S\+ / 46 \nextgroup = gitattributesAttribute skipwhite 47 48hi def link gitattributesAssign Operator 49hi def link gitattributesBoolean Boolean 50hi def link gitattributesComment Comment 51hi def link gitattributesGlob Special 52hi def link gitattributesMacro Define 53hi def link gitattributesName Identifier 54hi def link gitattributesPrefix SpecialChar 55hi def link gitattributesRange Special 56hi def link gitattributesSeparator Delimiter 57hi def link gitattributesString String 58hi def link gitattributesTodo Todo 59 60let b: current_syntax = 'gitattributes' 61 62let & cpoptions = s: cpo_save 63unlet s: cpo_save