]> git.donarmstrong.com Git - lilypond.git/blob - vim/lilypond-ftplugin.vim
* flower/string.cc (substitute): Take two strings or two
[lilypond.git] / vim / lilypond-ftplugin.vim
1 " LilyPond filetype plugin
2 " Language:     LilyPond (ft=ly)
3 " Maintainer:   Heikki Junes <hjunes@cc.hut.fi>
4 " Last Change:  2004 March 1
5 "
6 " Installed As: vim/ftplugin/lilypond.vim
7 " Uses Generated File:  vim/syntax/lilypond-words.el
8 "
9 " Only do this when not done yet for this buffer
10 if exists("b:did_ftplugin")
11   finish
12 endif
13
14 " Don't load another plugin for this buffer
15 let b:did_ftplugin = 1
16
17 setlocal autoindent
18 setlocal shiftwidth=2
19 "
20 " some handy key mappings
21 "
22 " <F4>  save & make and play midi
23 map <buffer> <F4> :w<Return>:se makeprg=lilypond\ -m\ %<<Return>:make<Return>:!timidity %<.midi<Return>
24 "
25 " <F5>  save & make dvi, midi, ps
26 map <buffer> <F5> :w<Return>:se makeprg=lilypond\ %<<Return>:make<Return>
27 "
28 " <F6>  view ps
29 map <buffer> <F6> :!gv -watch %<.ps &<Return>
30 "
31 " <S-F6>  view dvi
32 map <buffer> <S-F6> :!xdvi %<.dvi &<Return>
33 "
34 " <F7>  prev error
35 map <buffer> <F7> :cp<Return>
36 "
37 " <F8>  next error
38 map <buffer> <F8> :cn<Return>
39 "
40 " <F9>  make
41 map <buffer> <F9> :w<Return>:se makeprg=make\ -k<Return>:make<Return>
42 "
43 " <F10> menu
44 source $VIMRUNTIME/menu.vim
45 setlocal wildmenu
46 setlocal cpo-=<
47 setlocal wcm=<C-Z>
48 map <buffer> <F10> :emenu <C-Z>
49 "
50 " <F12> comment region
51 map <buffer> <F12> :g!/%.*/normal 0i%<Return>
52 "
53 " <S-F12> remove comments in region
54 map <buffer> <S-F12> :g/%.*/normal 0x<Return>
55 "
56 " Completions in Insert/Replace-mode with <Ctrl-N>
57 setlocal dictionary-=$VIM/syntax/lilypond-words dictionary+=$VIM/syntax/lilypond-words
58 setlocal complete-=k complete+=k
59 "
60 setlocal showmatch