839
|
1 " Vim syntax file
|
|
2 " Language: ChordPro (v. 3.6.2)
|
|
3 " Maintainer: Niels Bo Andersen <niels@niboan.dk>
|
856
|
4 " Last Change: 2006 Apr 30
|
839
|
5 " Remark: Requires VIM version 6.00 or greater
|
|
6
|
|
7 " Quit when a syntax file was already loaded
|
|
8 if exists("b:current_syntax")
|
|
9 finish
|
|
10 endif
|
|
11
|
|
12 let s:cpo_save = &cpo
|
|
13 set cpo&vim
|
|
14
|
|
15 setlocal iskeyword+=-
|
|
16
|
|
17 syn case ignore
|
|
18
|
|
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
|
|
22 \ column_break colb
|
|
23
|
|
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
|
|
27
|
|
28 syn keyword chordproDefineKeyword contained base-fret frets
|
|
29
|
|
30 syn match chordproDirMatch /{\w*}/ contains=chordproDirective contained transparent
|
|
31 syn match chordproDirOptMatch /{\w*:/ contains=chordproDirWithOpt contained transparent
|
|
32
|
|
33 " Workaround for a bug in VIM 6, which causes incorrect coloring of the first {
|
|
34 if version < 700
|
|
35 syn region chordproOptions start=/{\w*:/ end=/}/ contains=chordproDirOptMatch contained transparent
|
|
36 syn region chordproOptions start=/{define:/ end=/}/ contains=chordproDirOptMatch, chordproDefineKeyword contained transparent
|
|
37 else
|
|
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
|
|
40 endif
|
|
41
|
|
42 syn region chordproTag start=/{/ end=/}/ contains=chordproDirMatch,chordproOptions oneline
|
|
43
|
|
44 syn region chordproChord matchgroup=chordproBracket start=/\[/ end=/]/ oneline
|
|
45
|
|
46 syn region chordproTab start=/{start_of_tab}\|{sot}/hs=e+1 end=/{end_of_tab}\|{eot}/he=s-1 contains=chordproTag,chordproComment keepend
|
|
47
|
|
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
|
|
49
|
|
50 syn match chordproComment /^#.*/
|
|
51
|
|
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
|
|
63
|
|
64 let b:current_syntax = "chordpro"
|
|
65
|
|
66 let &cpo = s:cpo_save
|
|
67 unlet s:cpo_save
|