2 " Language: ChordPro (v. 3.6.2)
3 " Maintainer: Niels Bo Andersen <niels@niboan.dk>
4 " Last Change: 2006 Apr 30
5 " Remark: Requires VIM version 6.00 or greater
7 " Quit when a syntax file was already loaded
8 if exists("b:current_syntax")
19 syn keyword chordproDirective contained
20 \ start_of_chorus soc end_of_chorus eoc new_song ns no_grid ng grid g
21 \ new_page np new_physical_page npp start_of_tab sot end_of_tab eot
24 syn keyword chordproDirWithOpt contained
25 \ comment c comment_italic ci comment_box cb title t subtitle st define
26 \ textfont textsize chordfont chordsize columns col
28 syn keyword chordproDefineKeyword contained base-fret frets
30 syn match chordproDirMatch /{\w*}/ contains=chordproDirective contained transparent
31 syn match chordproDirOptMatch /{\w*:/ contains=chordproDirWithOpt contained transparent
33 " Workaround for a bug in VIM 6, which causes incorrect coloring of the first {
35 syn region chordproOptions start=/{\w*:/ end=/}/ contains=chordproDirOptMatch contained transparent
36 syn region chordproOptions start=/{define:/ end=/}/ contains=chordproDirOptMatch, chordproDefineKeyword contained transparent
38 syn region chordproOptions start=/{\w*:/hs=e+1 end=/}/he=s-1 contains=chordproDirOptMatch contained
39 syn region chordproOptions start=/{define:/hs=e+1 end=/}/he=s-1 contains=chordproDirOptMatch, chordproDefineKeyword contained
42 syn region chordproTag start=/{/ end=/}/ contains=chordproDirMatch,chordproOptions oneline
44 syn region chordproChord matchgroup=chordproBracket start=/\[/ end=/]/ oneline
46 syn region chordproTab start=/{start_of_tab}\|{sot}/hs=e+1 end=/{end_of_tab}\|{eot}/he=s-1 contains=chordproTag,chordproComment keepend
48 syn region chordproChorus start=/{start_of_chorus}\|{soc}/hs=e+1 end=/{end_of_chorus}\|{eoc}/he=s-1 contains=chordproTag,chordproChord,chordproComment keepend
50 syn match chordproComment /^#.*/
52 " Define the default highlighting.
53 hi def link chordproDirective Statement
54 hi def link chordproDirWithOpt Statement
55 hi def link chordproOptions Special
56 hi def link chordproChord Type
57 hi def link chordproTag Constant
58 hi def link chordproTab PreProc
59 hi def link chordproComment Comment
60 hi def link chordproBracket Constant
61 hi def link chordproDefineKeyword Type
62 hi def chordproChorus term=bold cterm=bold gui=bold
64 let b:current_syntax = "chordpro"