From e6bfb8f7065ded88ebc1af4dec865a715f33f03f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 3 Nov 2017 22:55:39 +1300 Subject: 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. --- vim/ftplugin/html.vim | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'vim/ftplugin/html.vim') diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim index d705bd71..4d3991f3 100644 --- a/vim/ftplugin/html.vim +++ b/vim/ftplugin/html.vim @@ -1,10 +1,5 @@ " Run tidy -eq -utf8 on file for the current buffer -if exists('*shellescape') - function s:HTMLTidy() - execute '!tidy -eq -utf8 ' . shellescape(expand('%')) - endfunction - nnoremap v :execute :call HTMLTidy() -endif +nnoremap v :write !tidy -eq -utf8 " Make a bare URL into a link to itself function! s:UrlLink() -- cgit v1.2.3