robin/laufey

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

zeertzjqvim-patch:62d8f3d: runtime: Revert several "mark invalid contact addresses" commits (#37192)ab20681c52

master
6.5 KiB174 linesraw
1" Vim syntax file
2" Language:     ChordPro 6 (https://www.chordpro.org)
3" Maintainer:   Niels Bo Andersen <niels@niboan.dk>
4" Last Change:  2022-04-15
5" 2024 Dec 31:  add "keys" as syntax keyword (via: https://groups.google.com/g/vim_dev/c/vP4epus0euM/m/mNoDY6hsCQAJ)
6
7" Quit when a syntax file was already loaded
8if exists("b:current_syntax")
9  finish
10endif
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15syn case ignore
16
17" Include embedded abc syntax
18syn include @Abc syntax/abc.vim
19
20" Lilypond and Pango syntaxes could be embedded as well, but they are not
21" available in the distribution.
22
23" Directives without arguments
24syn keyword chordproDirective contained nextgroup=chordproConditional
25  \ new_song ns
26  \ start_of_chorus soc
27  \ chorus
28  \ start_of_verse sov
29  \ start_of_bridge sob
30  \ start_of_tab sot
31  \ start_of_grid sog
32  \ start_of_abc
33  \ start_of_ly
34  \ end_of_chorus eoc
35  \ end_of_verse eov
36  \ end_of_bridge eob
37  \ end_of_tab eot
38  \ end_of_grid eog
39  \ end_of_abc
40  \ end_of_ly
41  \ new_page np
42  \ new_physical_page npp
43  \ column_break cb
44  \ grid g
45  \ no_grid ng
46  \ transpose
47  \ chordfont cf chordsize cs chordcolour
48  \ footerfont footersize footercolour
49  \ gridfont gridsize gridcolour
50  \ tabfont tabsize tabcolour
51  \ tocfont tocsize toccolour
52  \ textfont tf textsize ts textcolour
53  \ titlefont titlesize titlecolour
54
55" Directives with arguments. Some directives are in both groups, as they can
56" be used both with and without arguments
57syn keyword chordproDirWithArg contained nextgroup=chordproConditional
58  \ title t
59  \ subtitle st
60  \ sorttitle
61  \ artist
62  \ composer
63  \ lyricist
64  \ arranger
65  \ copyright
66  \ album
67  \ year
68  \ key
69  \ time
70  \ tempo
71  \ duration
72  \ capo
73  \ comment c
74  \ highlight
75  \ comment_italic ci
76  \ comment_box cb
77  \ image
78  \ start_of_chorus soc
79  \ chorus
80  \ start_of_verse sov
81  \ start_of_bridge sob
82  \ start_of_tab sot
83  \ start_of_grid sog
84  \ start_of_abc
85  \ start_of_ly
86  \ define
87  \ chord
88  \ transpose
89  \ chordfont cf chordsize cs chordcolour
90  \ footerfont footersize footercolour
91  \ gridfont gridsize gridcolour
92  \ tabfont tabsize tabcolour
93  \ tocfont tocsize toccolour
94  \ textfont tf textsize ts textcolour
95  \ titlefont titlesize titlecolour
96  \ pagetype
97  \ titles
98  \ columns col
99
100syn keyword chordproMetaKeyword contained meta
101syn keyword chordproMetadata contained title sorttitle subtitle artist composer lyricist arranger copyright album year key time tempo duration capo
102syn keyword chordproStandardMetadata contained songindex page pages pagerange today tuning instrument user
103syn match chordproStandardMetadata /instrument\.type/ contained
104syn match chordproStandardMetadata /instrument\.description/ contained
105syn match chordproStandardMetadata /user\.name/ contained
106syn match chordproStandardMetadata /user\.fullname/ contained
107
108syn keyword chordproDefineKeyword contained frets fingers keys
109syn match chordproDefineKeyword /base-fret/ contained
110
111syn match chordproArgumentsNumber /\d\+/ contained
112
113syn match chordproCustom /x_\w\+/ contained
114
115syn match chordproDirMatch /{\w\+\(-\w\+\)\?}/ contains=chordproDirective contained transparent
116syn match chordproDirArgMatch /{\w\+\(-\w\+\)\?[: ]/ contains=chordproDirWithArg contained transparent
117syn match chordproMetaMatch /{meta\(-\w\+\)\?[: ]\+\w\+/ contains=chordproMetaKeyword,chordproMetadata contained transparent
118syn match chordproCustomMatch /{x_\w\+\(-\w\+\)\?[: ]/ contains=chordproCustom contained transparent
119
120syn match chordproConditional /-\w\+/ contained
121
122syn match chordproMetaDataOperator /[=|]/ contained
123syn match chordproMetaDataValue /%{\w*/ contains=chordproMetaData,chordproStandardMetadata contained transparent
124" Handles nested metadata tags, but the end of the containing chordproTag is
125" not highlighted correctly, if there are more than two levels of nesting
126syn region chordproMetaDataTag start=/%{\w*/ skip=/%{[^}]*}/ end=/}/ contains=chordproMetaDataValue,chordproMetaDataOperator,chordproMetadataTag contained
127
128syn region chordproArguments start=/{\w\+\(-\w\+\)\?[: ]/hs=e+1 skip=/%{[^}]*}/ end=/}/he=s-1 contains=chordproDirArgMatch,chordproArgumentsNumber,chordproMetaDataTag contained
129syn region chordproArguments start=/{\(define\|chord\)\(-\w\+\)\?[: ]/hs=e+1 end=/}/he=s-1 contains=chordproDirArgMatch,chordproDefineKeyword,chordproArgumentsNumber contained
130syn region chordproArguments start=/{meta\(-\w\+\)\?[: ]/hs=e+1 skip=/%{[^}]*}/ end=/}/he=s-1 contains=chordproMetaMatch,chordproMetaDataTag contained
131syn region chordproArguments start=/{x_\w\+\(-\w\+\)\?[: ]/hs=e+1 end=/}/he=s-1 contains=chordproCustomMatch contained
132
133syn region chordproTag start=/{/ skip=/%{[^}]*}/ end=/}/ contains=chordproDirMatch,chordproArguments oneline
134
135syn region chordproChord matchgroup=chordproBracket start=/\[/ end=/]/ oneline
136
137syn region chordproAnnotation matchgroup=chordproBracket start=/\[\*/ end=/]/ oneline
138
139syn region chordproTab start=/{start_of_tab\(-\w\+\)\?\([: ].\+\)\?}\|{sot\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_tab}\|{eot}/me=s-1 contains=chordproTag,chordproComment keepend
140
141syn region chordproChorus start=/{start_of_chorus\(-\w\+\)\?\([: ].\+\)\?}\|{soc\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_chorus}\|{eoc}/me=s-1 contains=chordproTag,chordproChord,chordproAnnotation,chordproComment keepend
142
143syn region chordproBridge start=/{start_of_bridge\(-\w\+\)\?\([: ].\+\)\?}\|{sob\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_bridge}\|{eob}/me=s-1 contains=chordproTag,chordproChord,chordproAnnotation,chordproComment keepend
144
145syn region chordproAbc start=/{start_of_abc\(-\w\+\)\?\([: ].\+\)\?}/hs=e+1 end=/{end_of_abc}/me=s-1 contains=chordproTag,@Abc keepend
146
147syn match chordproComment /^#.*/
148
149" Define the default highlighting.
150hi def link chordproDirective Statement
151hi def link chordproDirWithArg Statement
152hi def link chordproConditional Statement
153hi def link chordproCustom Statement
154hi def link chordproMetaKeyword Statement
155hi def link chordproMetaDataOperator Operator
156hi def link chordproMetaDataTag Function
157hi def link chordproArguments Special
158hi def link chordproArgumentsNumber Number
159hi def link chordproChord Type
160hi def link chordproAnnotation Identifier
161hi def link chordproTag Constant
162hi def link chordproTab PreProc
163hi def link chordproComment Comment
164hi def link chordproBracket Constant
165hi def link chordproDefineKeyword Identifier
166hi def link chordproMetadata Identifier
167hi def link chordproStandardMetadata Identifier
168hi def chordproChorus term=bold cterm=bold gui=bold
169hi def chordproBridge term=italic cterm=italic gui=italic
170
171let b:current_syntax = "chordpro"
172
173let &cpo = s:cpo_save
174unlet s:cpo_save