annotate runtime/syntax/gitattributes.vim @ 30202:fee9eccee266

Update runtime files Commit: https://github.com/vim/vim/commit/71b6d3397649fed68ef587aa863fcbdf5fdb057a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 10 13:13:14 2022 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Sep 2022 14:15:06 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: git attributes
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: ObserverOfTime <chronobserver@disroot.org>
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Filenames: .gitattributes, *.git/info/attributes
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 " Last Change: 2022 Sep 09
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 if exists('b:current_syntax')
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 finish
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 endif
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 let s:cpo_save = &cpoptions
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 set cpoptions&vim
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 " Comment
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 syn keyword gitattributesTodo contained TODO FIXME XXX
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 syn match gitattributesComment /^\s*#.*/ contains=gitattributesTodo
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 " Pattern
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 syn match gitattributesPattern /^\s*#\@!\(".\+"\|\S\+\)/ skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 \ contains=gitattributesGlob,gitattributesRange,gitattributesSeparator
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn match gitattributesGlob /\\\@1<![?*]/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 syn match gitattributesRange /\\\@1<!\[.\{-}\]/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn match gitattributesSeparator '/' contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 " Attribute
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn match gitattributesAttrPrefixed /[!-]\?[A-Za-z0-9_.][-A-Za-z0-9_.]*/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 \ transparent contained skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 \ contains=gitattributesPrefix,gitattributesName
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 syn match gitattributesAttrAssigned /[A-Za-z0-9_.][-A-Za-z0-9_.]*=\S\+/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 \ transparent contained skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 \ contains=gitattributesName,gitattributesAssign,gitattributesBoolean,gitattributesString
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 syn match gitattributesName /[A-Za-z0-9_.][-A-Za-z0-9_.]*/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 \ contained nextgroup=gitattributesAssign
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 syn match gitattributesPrefix /[!-]/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 \ nextgroup=gitAttributesName
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 syn match gitattributesAssign '=' contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 \ nextgroup=gitattributesBoolean,gitattributesString
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 syn match gitattributesString /=\@1<=\S\+/ contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 syn keyword gitattributesBoolean true false contained
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 " Macro
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 syn match gitattributesMacro /^\s*\[attr\]\s*\S\+/
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 \ nextgroup=gitattributesAttribute skipwhite
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 hi def link gitattributesAssign Operator
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 hi def link gitattributesBoolean Boolean
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 hi def link gitattributesComment Comment
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 hi def link gitattributesGlob Special
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 hi def link gitattributesMacro Define
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 hi def link gitattributesName Identifier
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 hi def link gitattributesPrefix SpecialChar
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 hi def link gitattributesRange Special
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 hi def link gitattributesSeparator Delimiter
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 hi def link gitattributesString String
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 hi def link gitattributesTodo Todo
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 let b:current_syntax = 'gitattributes'
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 let &cpoptions = s:cpo_save
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 unlet s:cpo_save