X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=vim%2Flilypond-syntax.vim;h=c8322f697e4808e3ed673bc3e7af782ea624dd06;hb=f509f0d4df0b7d4336d904ca61902ad67dc2be5e;hp=a69f30c9618a03f9d647f99d4774466f33c5a51c;hpb=6c08722ad9d26f016832a2d6851d8c9addf62de7;p=lilypond.git diff --git a/vim/lilypond-syntax.vim b/vim/lilypond-syntax.vim index a69f30c961..c8322f697e 100644 --- a/vim/lilypond-syntax.vim +++ b/vim/lilypond-syntax.vim @@ -1,12 +1,11 @@ -" Vim syntax file +" LilyPond syntax file " Language: LilyPond " Maintainer: Heikki Junes -" Created: Oct 17, 2002 -" Last Change: Sep 23, 2003 -" Version: 6.1-1 -" Latest: -" http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lilypond.vim - +" Last Change: 2010 Jul 26 +" +" Installed As: vim/syntax/lilypond.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 if version < 600 @@ -18,9 +17,9 @@ endif " Read the LilyPond syntax match groups: " lilyKeyword, lilyReservedWord, lilyNote if version < 600 - so :p:h/lilypond.words.vim + so :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 @@ -32,7 +31,7 @@ setlocal mps+=<:> " 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 @@ -43,10 +42,17 @@ syn region lilyComment start="%{" skip="%$" end="%}" 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 " @@ -67,6 +73,7 @@ if version >= 508 || !exists("did_lily_syn_inits") HiLink lilyComment Comment HiLink lilyNote Identifier + HiLink lilyArticulation PreProc HiLink lilyKeyword Keyword HiLink lilyReservedWord Type @@ -76,3 +83,5 @@ if version >= 508 || !exists("did_lily_syn_inits") delcommand HiLink endif + +let b:current_syntax = "lilypond"