diff options
author | Patrick McCarty <pnorcks@gmail.com> | 2010-07-26 12:39:44 -0700 |
---|---|---|
committer | Patrick McCarty <pnorcks@gmail.com> | 2010-07-26 12:50:02 -0700 |
commit | 1ba18009f32e46a6b25436bbdc20c7d1ceb832d2 (patch) | |
tree | add30dea6209e3530a6cbe1ad3433aea74966a5d /vim | |
parent | c8499b5d525a5b48e72bc1d134a333224bbd212a (diff) |
Vim: Use Lisp-style indentation where appropriate.
Diffstat (limited to 'vim')
-rw-r--r-- | vim/lilypond-indent.vim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/vim/lilypond-indent.vim b/vim/lilypond-indent.vim index 25d92e9baa..ea82090ec8 100644 --- a/vim/lilypond-indent.vim +++ b/vim/lilypond-indent.vim @@ -1,7 +1,7 @@ " LilyPond indent file " Language: LilyPond " Maintainer: Heikki Junes <hjunes@cc.hut.fi> -" Last Change: 2004 Mar 01 +" Last Change: 2010 Jul 26 " " Installed As: vim/indent/lilypond.vim " @@ -38,6 +38,16 @@ function GetLilyPondIndent() let ind = ind - &sw endif + " Check if the previous line is a `lilyScheme' region, and if + " so, use lisp-style indentation for the current line. + " TODO: only works in version 7.1.215 or later, though it should + " silently fail in older versions. + for id in synstack(lnum, 1) + if synIDattr(id, "name") == "lilyScheme" + let ind = lispindent(v:lnum) + endif + endfor + return ind endfunction " |