use perltidy for equalprg if present

Sun, 01 Oct 2017 16:40:58 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 01 Oct 2017 16:40:58 -0400
changeset 651
4a0d4c07b49e
parent 650
3728333503b6
child 652
2d0fad481fa5

use perltidy for equalprg if present

.vim/after/syntax/perl/custom.vim file | annotate | diff | comparison | revisions
.vimrc file | annotate | diff | comparison | revisions
--- a/.vim/after/syntax/perl/custom.vim
+++ b/.vim/after/syntax/perl/custom.vim
@@ -5,6 +5,10 @@ compiler perl
 setlocal makeprg=perl\ -c\ %\ $*
 setlocal iskeyword+=:
 
+if g:perl_tidy_equalprg
+  setlocal equalprg=perltidy\ -q
+endif
+
 " this keeps indents from jumping more than one level
 let b:indent_use_syntax = 0
 
--- a/.vimrc
+++ b/.vimrc
@@ -305,9 +305,10 @@ augroup END
 "}}}
 
 " Perl type-specific settings  {{{
-let perl_include_pod = 1
-let perl_sub_signatures = 1
-let perl_sync_dist = 200
+let perl_include_pod     = 1
+let perl_sub_signatures  = 1
+let perl_sync_dist       = 200
+let g:perl_tidy_equalprg = executable('perltidy') ? 1 : 0
 " }}}
 
 " Plugin settings  {{{

mercurial