equal
deleted
inserted
replaced
|
1 "nach ~/.vim/ftplugin/ |
|
2 " |
|
3 :setlocal |
|
4 set equalprg=perltidy\ -q |
|
5 |
|
6 nmap <C-G>f :call HS_format()<ENTER> |
|
7 nmap <C-G>p :call HS_pod()<ENTER> |
|
8 nmap <C-G>c :call HS_check()<ENTER> |
|
9 |
|
10 command! Tidy :call HS_format() |
|
11 command! Pod :call HS_pod() |
|
12 |
|
13 function! HS_check() |
|
14 :w |
|
15 :!perl -Mblib -c % |
|
16 endfunc |
|
17 |
|
18 function! HS_format() |
|
19 |
|
20 let dir = fnamemodify(expand("%"), ":p:h") |
|
21 let rc = dir . "/.perltidyrc" |
|
22 if filereadable(rc) != 1 |
|
23 echo "HEHE, no .perltidyrc in " . dir |
|
24 return |
|
25 endif |
|
26 |
|
27 let old = &equalprg |
|
28 let &equalprg = "perltidy -pro=" . rc |
|
29 normal gg=G |
|
30 normal `` |
|
31 let &equalprg = old |
|
32 |
|
33 endfunc |
|
34 |
|
35 function! HS_pod() |
|
36 :!perldoc % |
|
37 endfunc |
|
38 |
|
39 " vim:ft=vim: |