aboutsummaryrefslogtreecommitdiff
path: root/vim/ftplugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-03 20:43:38 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-03 20:43:38 +1300
commit854b2273e58f3e831297336dcaa2e2646461b5ce (patch)
treefceeba33b63f6571aac1d55f978afa5590a376b3 /vim/ftplugin
parentMerge branch 'feature/local-leader' into develop (diff)
downloaddotfiles-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.
Diffstat (limited to 'vim/ftplugin')
-rw-r--r--vim/ftplugin/html.vim5
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()