diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-03 20:43:38 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-03 20:43:38 +1300 |
commit | 854b2273e58f3e831297336dcaa2e2646461b5ce (patch) | |
tree | fceeba33b63f6571aac1d55f978afa5590a376b3 | |
parent | Merge branch 'feature/local-leader' into develop (diff) | |
download | dotfiles-854b2273e58f3e831297336dcaa2e2646461b5ce.tar.gz dotfiles-854b2273e58f3e831297336dcaa2e2646461b5ce.zip |
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.
-rw-r--r-- | vim/ftplugin/html.vim | 5 |
1 files changed, 4 insertions, 1 deletions
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 <LocalLeader>v :exe "!tidy -eq -utf8 " . shellescape(expand("%"))<CR> +function s:HTMLTidy() + execute '!tidy -eq -utf8 ' . shellescape(expand('%')) +endfunction +nnoremap <LocalLeader>v :exe :<C-U>call <SID>HTMLTidy()<CR> " Make a bare URL into a link to itself function! s:UrlLink() |