diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-03 22:47:59 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-03 22:47:59 +1300 |
commit | 04031093dd873153b8af734fae5122bf27dcdb19 (patch) | |
tree | 971462c2ef8df1dd28ce93874861c0020f04fd56 /vim/ftplugin/html.vim | |
parent | Revert "Adjust UrlLink() to yank word without t... (diff) | |
download | dotfiles-04031093dd873153b8af734fae5122bf27dcdb19.tar.gz dotfiles-04031093dd873153b8af734fae5122bf27dcdb19.zip |
Check for availability of Vim shellescape()
It doesn't seem to be in very old Vims; worth testing for to avoid
errors if I try to use the function.
Diffstat (limited to 'vim/ftplugin/html.vim')
-rw-r--r-- | vim/ftplugin/html.vim | 10 |
1 files changed, 6 insertions, 4 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() |