aboutsummaryrefslogtreecommitdiff
path: root/vim/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'vim/ftplugin')
-rw-r--r--vim/ftplugin/html.vim10
-rw-r--r--vim/ftplugin/perl.vim17
2 files changed, 17 insertions, 10 deletions
diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim
index 7400326c..5505dbaa 100644
--- a/vim/ftplugin/html.vim
+++ b/vim/ftplugin/html.vim
@@ -1,8 +1,10 @@
" Run tidy -eq -utf8 on file for the current buffer
-function s:HTMLTidy()
- execute '!tidy -eq -utf8 ' . shellescape(expand('%'))
-endfunction
-nnoremap <LocalLeader>v :exe :<C-U>call <SID>HTMLTidy()<CR>
+if exists('*shellescape')
+ function s:HTMLTidy()
+ execute '!tidy -eq -utf8 ' . shellescape(expand('%'))
+ endfunction
+ nnoremap <LocalLeader>v :exe :<C-U>call <SID>HTMLTidy()<CR>
+endif
" Make a bare URL into a link to itself
function! s:UrlLink()
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim
index 53341183..c4923051 100644
--- a/vim/ftplugin/perl.vim
+++ b/vim/ftplugin/perl.vim
@@ -1,6 +1,11 @@
-" Run perl -c on file for the current buffer
-nnoremap <LocalLeader>pc :exe "!perl -c " . shellescape(expand("%"))<CR>
-" Run perlcritic on the file for the current buffer
-nnoremap <LocalLeader>pl :exe "!perlcritic " . shellescape(expand("%"))<CR>
-" Run the current buffer through perltidy
-nnoremap <LocalLeader>pt :%!perltidy<CR>
+" External commands for Perl files
+if exists('*shellescape')
+
+ " Run perl -c on file for the current buffer
+ nnoremap <LocalLeader>pc :exe "!perl -c " . shellescape(expand("%"))<CR>
+ " Run perlcritic on the file for the current buffer
+ nnoremap <LocalLeader>pl :exe "!perlcritic " . shellescape(expand("%"))<CR>
+ " Run the current buffer through perltidy
+ nnoremap <LocalLeader>pt :%!perltidy<CR>
+
+endif