]> git.donarmstrong.com Git - lilypond.git/blob - vim/lilypond-indent.vim
e2426d6d89c2e66633bfd32b94279c0ef79cd671
[lilypond.git] / vim / lilypond-indent.vim
1 " LilyPond indent file
2 " Language:     LilyPond
3 " Maintainer:   Heikki Junes <hjunes@cc.hut.fi>
4 " Last Change:  2004 Mar 01
5
6 " Only load this indent file when no other was loaded.
7 if exists("b:did_indent")
8   finish
9 endif
10 let b:did_indent = 1
11
12 setlocal indentexpr=GetLilyPondIndent()
13
14 " Only define the function once.
15 if exists("*GetLilyPondIndent")
16   finish
17 endif
18
19 function GetLilyPondIndent()
20   if v:lnum == 1
21     return 0
22   endif
23
24   "Find a non-blank line above the current line.
25   let lnum = prevnonblank(v:lnum - 1)
26   let ind = indent(lnum)
27
28   return ind
29 endfunction
30 "
31 "
32 "