]> git.donarmstrong.com Git - lilypond.git/blobdiff - vim/ftplugin/lilypond.vim
apply bindings only locally.
[lilypond.git] / vim / ftplugin / lilypond.vim
index 7568025451a9f1648cc174baf7fa270e90f7ab90..67afd28bc1eb4d42cfdb74477006cb6aab7146cc 100644 (file)
@@ -1,48 +1,54 @@
-:version 6.1
+" LilyPond filetype plugin
+" Language:     LilyPond (ft=ly)
+" Maintainer:   Heikki Junes <hjunes@cc.hut.fi>
+" Last Change:  2004 March 1
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
 set autoindent
 set shiftwidth=2
 "
 " some handy key mappings
 "
-" <F2>  save and go to previous buffer
-map <F2> :w<Return>:bp<Return>
-"
-" <F3>  save and go to next buffer
-map <F3> :w<Return>:bn<Return>
-"
 " <F4>  save & make and play midi
-map <F4> :w<Return>:se makeprg=lilypond\ -m\ %<<Return>:make<Return>:!timidity %<.midi<Return>
+map <buffer> <F4> :w<Return>:se makeprg=lilypond\ -m\ %<<Return>:make<Return>:!timidity %<.midi<Return>
 "
 " <F5>  save & make dvi, midi, ps
-map <F5> :w<Return>:se makeprg=lilypond\ %<<Return>:make<Return>
+map <buffer> <F5> :w<Return>:se makeprg=lilypond\ %<<Return>:make<Return>
 "
 " <F6>  view ps
-map <F6> :!gv -watch %<.ps &<Return>
+map <buffer> <F6> :!gv -watch %<.ps &<Return>
 "
 " <S-F6>  view dvi
-map <S-F6> :!xdvi %<.dvi &<Return>
+map <buffer> <S-F6> :!xdvi %<.dvi &<Return>
 "
 " <F7>  prev error
-map <F7> :cp<Return>
+map <buffer> <F7> :cp<Return>
 "
 " <F8>  next error
-map <F8> :cn<Return>
+map <buffer> <F8> :cn<Return>
 "
 " <F9>  make
-map <F9> :w<Return>:se makeprg=make\ -k<Return>:make<Return>
+map <buffer> <F9> :w<Return>:se makeprg=make\ -k<Return>:make<Return>
 "
 " <F10> menu
 :source $VIMRUNTIME/menu.vim
 :set wildmenu
 :set cpo-=<
 :set wcm=<C-Z>
-:map <F10> :emenu <C-Z>
+:map <buffer> <F10> :emenu <C-Z>
 "
 " <F12> comment region
-map <F12> :g!/%.*/normal 0i%<Return>
+map <buffer> <F12> :g!/%.*/normal 0i%<Return>
 "
 " <S-F12> remove comments in region
-map <S-F12> :g/%.*/normal 0x<Return>
+map <buffer> <S-F12> :g/%.*/normal 0x<Return>
 "
 " Completions in Insert/Replace-mode with <Ctrl-N>
 set dictionary-=~/.vim/syntax/lilypond.words.el dictionary+=~/.vim/syntax/lilypond.words.el