3 " Maintainer: Heikki Junes <hjunes@cc.hut.fi>
4 " Last Change: 2004 Mar 01
6 " Only load this indent file when no other was loaded.
7 if exists("b:did_indent")
12 setlocal indentexpr=GetLilyPondIndent()
13 setlocal indentkeys+==},>>,!^F
15 " Only define the function once.
16 if exists("*GetLilyPondIndent")
20 function GetLilyPondIndent()
25 "Find a non-blank line above the current line.
26 let lnum = prevnonblank(v:lnum - 1)
27 "Check if a block was started: '{' or '<<' is the last non-blank character of the previous line.
28 if getline(lnum) =~ '^.*\({\|<<\)\s*$'
29 let ind = indent(lnum) + &sw
31 let ind = indent(lnum)
34 "Check if a block was ended: '}' or '>>' is the first non-blank character of the current line.
35 elseif getline(v:lnum) =~ '^\s*\(}\|>>\)'