" LilyPond syntax file
" Language: LilyPond
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
-" Created: Oct 17, 2002
-" Last Change: Sep 23, 2003
-" Version: 6.1-1
+" Last Change: 2010 Jul 26
"
" Installed As: vim/syntax/lilypond.vim
-" Uses Generated File: vim/syntax/lilypond.words.vim
+" Uses Generated File: vim/syntax/lilypond-words.vim
"
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
" Read the LilyPond syntax match groups:
" lilyKeyword, lilyReservedWord, lilyNote
if version < 600
- so <sfile>:p:h/lilypond.words.vim
+ so <sfile>:p:h/lilypond-words.vim
else
- runtime! syntax/lilypond.words.vim
+ runtime! syntax/lilypond-words.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
" Case matters
syn case match
-syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilyEquation,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyReservedWord
+syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyArticulation,lilyReservedWord,lilyScheme
syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[<>]" end="}" contains=@lilyMatchGroup fold
syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" contains=@lilyMatchGroup fold
syn region lilyComment start="%\([^{]\|$\)" end="$"
syn match lilyNumber "[-_^.]\?\d\+[.]\?"
-syn match lilyEquation "\(#['`]\)\?\(\a*[-]\)*\a*\s*=\s*\(#[#'`]\?\)\?\a*"
syn match lilySlur "[(~)]"
syn match lilySlur "\\[()]"
syn match lilySpecial "\\[<!>\\]"
+" avoid highlighting the extra character in situations like
+" c--\mf c^^\mf c__\mf
+syn match lilyArticulation "[-_^][-_^+|>.]"
+
+" Include Scheme syntax highlighting, where appropriate
+syn include @embeddedScheme syntax/scheme.vim
+unlet b:current_syntax
+syn region lilyScheme matchgroup=Delimiter start="#['`]\?(" matchgroup=Delimiter end=")" contains=@embeddedScheme
" Rest of syntax highlighting rules start here
"
HiLink lilyComment Comment
HiLink lilyNote Identifier
+ HiLink lilyArticulation PreProc
HiLink lilyKeyword Keyword
HiLink lilyReservedWord Type
delcommand HiLink
endif
+
+let b:current_syntax = "lilypond"