diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-10-24 02:40:06 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-10-24 03:31:57 -0400 |
commit | ba2de93f8527cd65a27bd1846c938c671eddf228 (patch) | |
tree | 607c45ed10a81eece299c16f89a07d0ea1b3eadb /vim/ftplugin/perl.vim | |
parent | 2cdd9d6858367976bfccc78a40ef2efdd82b8139 (diff) | |
download | conf-ba2de93f8527cd65a27bd1846c938c671eddf228.tar.gz conf-ba2de93f8527cd65a27bd1846c938c671eddf228.zip |
clean up some ftplugins
Diffstat (limited to 'vim/ftplugin/perl.vim')
-rw-r--r-- | vim/ftplugin/perl.vim | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index 9492f1d..085e940 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -1,43 +1,12 @@ let b:ale_linters = { 'perl': ['perlcritic'] } -" :make does a syntax check -if expand("%:e") == "psgi" - exe 'setlocal makeprg=plackup\ -Ilib\ -a\ ' . expand("%") -else - setlocal makeprg=$VIMRUNTIME/tools/efm_perl.pl\ -c\ %\ $* - setlocal errorformat=%f:%l:%m -endif - " look up words in perldoc rather than man for K function! s:perldoc(word) let perldoc_pager = $PERLDOC_PAGER let $PERLDOC_PAGER = 'cat' exe 'silent read! perldoc -f "' . a:word . '" 2>/dev/null || perldoc "' . a:word . '"' let $PERLDOC_PAGER = perldoc_pager - set ft=man -endfunction -nmap <buffer> <silent>K :call Help(0, [':'], '<SID>perldoc')<CR> -vmap <buffer> <silent>K :call Help(1, [':'], '<SID>perldoc')<CR> - -function! s:unpostfix() - let postop_pattern = '\<\(if\|unless\|while\|until\|for\)\>' - let indent = repeat(' ', &sw) - - if getline('.') =~ postop_pattern - normal kJ - else - normal J - endif - - " XXX this doesn't insert newlines properly - " let line = getline('.') - " let line = substitute( - " \line, - " \'\(\s*\)\(.*\) ' . postop_pattern . ' \(.*\);', - " \'\1\3 (\4) {\1' . indent . '\2;\n\1}', - " \'' - " \) - " call setline('.', line) - exe 's/\(\s*\)\(.*\) ' . postop_pattern . ' \(.*\);/\1\3 (\4) {\r\1' . indent . '\2;\r\1}/' + setlocal ft=man endfunction -map <buffer> <silent> <Leader>i :call <SID>unpostfix()<CR> +nnoremap <buffer> <silent>K :call Help(0, [':'], '<SID>perldoc')<CR> +vnoremap <buffer> <silent>K :call Help(1, [':'], '<SID>perldoc')<CR> |