]> git.donarmstrong.com Git - lilypond.git/commitdiff
vim/indent/lilypond.vim: new file.
authorHeikki Junes <heikki.junes@hut.fi>
Mon, 1 Mar 2004 17:23:40 +0000 (17:23 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Mon, 1 Mar 2004 17:23:40 +0000 (17:23 +0000)
ChangeLog
vim/indent/lilypond.vim [new file with mode: 0644]

index f5142e01c80496983bbe3450a12ecfc1311b0225..418b84998e20679ff4d7b8fea6ec066eb4430433 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,8 +12,9 @@
        * vimrc: add menu in console and shortcut <F10> for it.
 
        * vim/:
-       * vim/syntax:
-       * vim/ftplugin: new directories.
+       * vim/syntax/:
+       * vim/indent/:
+       * vim/ftplugin/: new directories.
        
        * vim/filetype.vim: new file.
 
@@ -26,6 +27,8 @@
        * vim/ftplugin/lilypond.vim: change dir for dictionary.
        add header. apply bindings only locally.
 
+       * vim/indent/lilypond.vim: new file.
+
        * Documentation/topdocs/INSTALL.texi: give easier orders.
 
        * ROADMAP: add vim/
diff --git a/vim/indent/lilypond.vim b/vim/indent/lilypond.vim
new file mode 100644 (file)
index 0000000..e2426d6
--- /dev/null
@@ -0,0 +1,32 @@
+" LilyPond indent file
+" Language:     LilyPond
+" Maintainer:   Heikki Junes <hjunes@cc.hut.fi>
+" Last Change:  2004 Mar 01
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetLilyPondIndent()
+
+" Only define the function once.
+if exists("*GetLilyPondIndent")
+  finish
+endif
+
+function GetLilyPondIndent()
+  if v:lnum == 1
+    return 0
+  endif
+
+  "Find a non-blank line above the current line.
+  let lnum = prevnonblank(v:lnum - 1)
+  let ind = indent(lnum)
+
+  return ind
+endfunction
+"
+"
+"