From 854b2273e58f3e831297336dcaa2e2646461b5ce Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 3 Nov 2017 20:43:38 +1300 Subject: Refactor HTML tidy(1) mapping Move the logic into a script function. Use single quotes for the strings, too, since we don't need interpolation. --- vim/ftplugin/html.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vim/ftplugin/html.vim') diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim index 309b7132..b305a223 100644 --- a/vim/ftplugin/html.vim +++ b/vim/ftplugin/html.vim @@ -1,5 +1,8 @@ " Run tidy -eq -utf8 on file for the current buffer -nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) +function s:HTMLTidy() + execute '!tidy -eq -utf8 ' . shellescape(expand('%')) +endfunction +nnoremap v :exe :call HTMLTidy() " Make a bare URL into a link to itself function! s:UrlLink() -- cgit v1.2.3