]> src.twobees.de Git - dotfiles.git/blob - stow/vim/.vim/ftplugin/perl.vim
initial
[dotfiles.git] / stow / vim / .vim / ftplugin / perl.vim
1 "define :Tidy command to run perltidy on visual selection || entire buffer"
2 command! -range=% -nargs=* Tidy <line1>,<line2>!perltidy
3
4 "run :Tidy on entire buffer and return cursor to (approximate) original position"
5 fun! DoTidy()
6     let l = line(".")
7     let c = col(".")
8     :Tidy
9     call cursor(l, c)
10 endfun
11
12 "shortcut for normal mode to run on entire buffer then return to current line"
13 noremap <F2> :call DoTidy()<CR>
14
15 "shortcut for visual mode to run on the the current visual selection"
16 vnoremap <F2> :Tidy<CR>