X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=vim%2Flilypond-indent.vim;h=25d92e9baaaac42bae678df6ddd6d39692e2d1da;hb=0d1bbea7ce87d79261e143171942b76aa9a8dad2;hp=1f6c681e3bf1c6e28f8db2da10551a047ab65401;hpb=845257fa959b66d0579fb78a26bfcaecb43d645c;p=lilypond.git diff --git a/vim/lilypond-indent.vim b/vim/lilypond-indent.vim index 1f6c681e3b..25d92e9baa 100644 --- a/vim/lilypond-indent.vim +++ b/vim/lilypond-indent.vim @@ -2,7 +2,9 @@ " Language: LilyPond " Maintainer: Heikki Junes " Last Change: 2004 Mar 01 - +" +" Installed As: vim/indent/lilypond.vim +" " Only load this indent file when no other was loaded. if exists("b:did_indent") finish @@ -10,7 +12,7 @@ endif let b:did_indent = 1 setlocal indentexpr=GetLilyPondIndent() -setlocal indentkeys+==},>>,! +setlocal indentkeys=o,O,},>>,!^F " Only define the function once. if exists("*GetLilyPondIndent") @@ -24,14 +26,14 @@ function GetLilyPondIndent() "Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) - "Check if a block was started: '{' or '<<' is the last non-blank character of the line. + "Check if a block was started: '{' or '<<' is the last non-blank character of the previous line. if getline(lnum) =~ '^.*\({\|<<\)\s*$' let ind = indent(lnum) + &sw else let ind = indent(lnum) endif - "Check if a block was ended: '}' or '>>' is the first non-blank character of the line. + "Check if a block was ended: '}' or '>>' is the first non-blank character of the current line. if getline(v:lnum) =~ '^\s*\(}\|>>\)' let ind = ind - &sw endif