Add Lilypond filetype to my vim settings

git-svn-id: http://photonzero.com/dotfiles/trunk@63 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
michener 2010-09-17 23:32:32 +00:00
parent 1a75b25298
commit e2368b4ee7
4 changed files with 1129 additions and 0 deletions

View file

@ -12,6 +12,9 @@ augroup END
augroup csv
au! BufNewFile,BufRead *.csv setf csv
augroup END
augroup lilypond
au! BufNewFile,BufRead *.ly,*.ily setf lilypond
augroup END
au BufRead,BufNewFile *.go set filetype=go

1040
.vim/syntax/lilypond-words Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

83
.vim/syntax/lilypond.vim Normal file
View file

@ -0,0 +1,83 @@
" 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
"
" 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
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Read the LilyPond syntax match groups:
" lilyKeyword, lilyReservedWord, lilyNote
if version < 600
so <sfile>:p:h/lilypond-words.vim
else
runtime! syntax/lilypond-words.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
endif
" Match also parethesis of angle type
setlocal mps+=<:>
" Case matters
syn case match
syn cluster lilyMatchGroup contains=lilyMatcher,lilyString,lilyComment,lilyStatement,lilyNumber,lilyEquation,lilySlur,lilySpecial,lilyNote,lilyKeyword,lilyArticulation,lilyReservedWord
syn region lilyMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[<>]" end="}" contains=@lilyMatchGroup fold
syn region lilyMatcher matchgroup=Delimiter start="\[" end="]" contains=@lilyMatchGroup fold
syn region lilyMatcher matchgroup=Delimiter start="<" skip="\\\\\|\\[{<>}]" end=">" contains=@lilyMatchGroup fold
syn region lilyString start=/"/ end=/"/ skip=/\\"/
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 "[-_^][-_^+|>.]"
" Rest of syntax highlighting rules start here
"
" " Define the default highlighting.
" " For version 5.7 and earlier: only when not done already
" " For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_lily_syn_inits")
if version < 508
let did_lily_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink Delimiter Identifier
HiLink lilyString String
HiLink lilyComment Comment
HiLink lilyNote Identifier
HiLink lilyArticulation PreProc
HiLink lilyKeyword Keyword
HiLink lilyReservedWord Type
HiLink lilyNumber Constant
HiLink lilySpecial Special
HiLink lilySlur ModeMsg
delcommand HiLink
endif