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