aboutsummaryrefslogtreecommitdiff
path: root/vim/ftplugin/html.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-03 22:55:39 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-03 22:59:43 +1300
commite6bfb8f7065ded88ebc1af4dec865a715f33f03f (patch)
treeced53afc29cf85faccf5954cfceb9eab58589543 /vim/ftplugin/html.vim
parent381812518e1625ffa3d000332e5198b5ac219f73 (diff)
downloaddotfiles-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/html.vim')
-rw-r--r--vim/ftplugin/html.vim7
1 files changed, 1 insertions, 6 deletions
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 <LocalLeader>v :execute :<C-U>call <SID>HTMLTidy()<CR>
-endif
+nnoremap <LocalLeader>v :write !tidy -eq -utf8<CR>
" Make a bare URL into a link to itself
function! s:UrlLink()