[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Vim-mode for LilyPond

From: Heikki Johannes Junes
Subject: Vim-mode for LilyPond
Date: Thu, 17 Oct 2002 18:14:18 +0300 (EET DST)

I made this vim-mode just for fun. If somebody uses vim maybe they will
like this. For example, slur matching works in vim.

Index: ChangeLog
RCS file: /cvsroot/lilypond/lilypond/ChangeLog,v
retrieving revision 1.560
diff -r1.560 ChangeLog
> 2002-10-17  Heikki Junes  <address@hidden>
>       * lilypond.vim: New file. Vim-mode for LilyPond.

Here is the "lilypond.vim"-file.

" Vim syntax file
" Language:     LilyPond
" Maintainer:   Heikki Junes <address@hidden>
" Last Change:  Oct 17, 2002
" Version:      6.1-1
" Latest:
" Lilypond:     1.7.3
" Notes:        Place this to, e.g., /usr/share/vim/syntax/lilypond.vim
"               add corresponding line to, e.g.,

" 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")

" Match also parethesis of angle type
set mps+=<:>

syn cluster lilyMatchGroup

syn region lilyMatcher  matchgroup=Delimiter start="{"
skip="\\\\\|\\[{<>}]"    end="}" address@hidden fold
syn region lilyMatcher  matchgroup=Delimiter start="\["         end="]"
address@hidden fold
syn region lilyMatcher  matchgroup=Delimiter start="<"
skip="\\\\\|\\[{<>}]" end=">"    address@hidden fold

syn region lilyString   start=/"/ end=/"/ skip=/\\"/
syn region lilyComment  start="%{" skip="%$" end="%}"
syn region lilyComment  start="%\([^{]\|$\)" end="$"

syn match lilyStatement "[-_^]\?\\\a\+"
syn match lilyNote
syn match lilyNumber    "[-_^.]\?\d\+[.]\?"
syn match lilyEquation
syn match lilySlur      "[(~)]"
syn match lilySlur      "\\[()]"
syn match lilySpecial   "\\[<!>\\]"

" 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
if version >= 508 || !exists("did_lily_syn_inits")
  if version < 508
    let did_lily_syn_inits = 1
    command -nargs=+ HiLink hi link <args>
    command -nargs=+ HiLink hi def link <args>

  HiLink Delimiter      Identifier

  HiLink lilyString     String
  HiLink lilyComment    Comment

  HiLink lilyNote       Identifier
  HiLink lilyNumber     Constant
  HiLink lilyStatement  Statement
  HiLink lilySpecial    Special
  HiLink lilySlur       ModeMsg

  delcommand HiLink

reply via email to

[Prev in Thread] Current Thread [Next in Thread]