]> git.donarmstrong.com Git - lilypond.git/blob - vim/lilypond-ftplugin.vim
mv lilypond-ftpplugin.vim lilypond-ftplugin.vim
[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 " Only do this when not done yet for this buffer
7 if exists("b:did_ftplugin")
8   finish
9 endif
10
11 " Don't load another plugin for this buffer
12 let b:did_ftplugin = 1
13
14 setlocal autoindent
15 setlocal shiftwidth=2
16 "
17 " some handy key mappings
18 "
19 " <F4>  save & make and play midi
20 map <buffer> <F4> :w<Return>:se makeprg=lilypond\ -m\ %<<Return>:make<Return>:!timidity %<.midi<Return>
21 "
22 " <F5>  save & make dvi, midi, ps
23 map <buffer> <F5> :w<Return>:se makeprg=lilypond\ %<<Return>:make<Return>
24 "
25 " <F6>  view ps
26 map <buffer> <F6> :!gv -watch %<.ps &<Return>
27 "
28 " <S-F6>  view dvi
29 map <buffer> <S-F6> :!xdvi %<.dvi &<Return>
30 "
31 " <F7>  prev error
32 map <buffer> <F7> :cp<Return>
33 "
34 " <F8>  next error
35 map <buffer> <F8> :cn<Return>
36 "
37 " <F9>  make
38 map <buffer> <F9> :w<Return>:se makeprg=make\ -k<Return>:make<Return>
39 "
40 " <F10> menu
41 source $VIMRUNTIME/menu.vim
42 setlocal wildmenu
43 setlocal cpo-=<
44 setlocal wcm=<C-Z>
45 map <buffer> <F10> :emenu <C-Z>
46 "
47 " <F12> comment region
48 map <buffer> <F12> :g!/%.*/normal 0i%<Return>
49 "
50 " <S-F12> remove comments in region
51 map <buffer> <S-F12> :g/%.*/normal 0x<Return>
52 "
53 " Completions in Insert/Replace-mode with <Ctrl-N>
54 setlocal dictionary-=~/.vim/syntax/lilypond.words.el dictionary+=~/.vim/syntax/lilypond.words.el
55 setlocal complete-=k complete+=k
56 "
57 setlocal showmatch