diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-03 22:55:39 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-03 22:59:43 +1300 |
commit | e6bfb8f7065ded88ebc1af4dec865a715f33f03f (patch) | |
tree | ced53afc29cf85faccf5954cfceb9eab58589543 /vim/ftplugin/perl.vim | |
parent | Use full ':execute' not just ':exe' in VimL (diff) | |
download | dotfiles-e6bfb8f7065ded88ebc1af4dec865a715f33f03f.tar.gz dotfiles-e6bfb8f7065ded88ebc1af4dec865a715f33f03f.zip |
Use direct :write !cmd instead of shellescape()
This is a much better method of calling external programs on the
buffer's contents, not just because it avoids the mess of :execute
evaluation but also because it doesn't require that there actually be a
filename for the current buffer.
This drastically simplifies the HTML tidy(1) call in particular.
Diffstat (limited to 'vim/ftplugin/perl.vim')
-rw-r--r-- | vim/ftplugin/perl.vim | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index 310ffe7e..eeed2bb7 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -1,11 +1,6 @@ -" External commands for Perl files -if exists('*shellescape') - - " Run perl -c on file for the current buffer - nnoremap <LocalLeader>pc :execute "!perl -c " . shellescape(expand("%"))<CR> - " Run perlcritic on the file for the current buffer - nnoremap <LocalLeader>pl :execute "!perlcritic " . shellescape(expand("%"))<CR> - " Run the current buffer through perltidy - nnoremap <LocalLeader>pt :%!perltidy<CR> - -endif +" Run perl -c on file for the current buffer +nnoremap <LocalLeader>pc :write !perl -c<CR> +" Run perlcritic on the file for the current buffer +nnoremap <LocalLeader>pl :write !perlcritic<CR> +" Run the current buffer through perltidy +nnoremap <LocalLeader>pt :%!perltidy<CR> |