diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-04 00:32:44 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-04 00:37:18 +1300 |
commit | 374ceec9af29401a183b3be44f5dc75e096abae9 (patch) | |
tree | c368ffbddf1afa798652aab59f76c2200b1fcf0d /vim/ftplugin/html.vim | |
parent | Break long lines in check/lint/tidy mappings (diff) | |
download | dotfiles-374ceec9af29401a183b3be44f5dc75e096abae9.tar.gz dotfiles-374ceec9af29401a183b3be44f5dc75e096abae9.zip |
Add tidy mapping for HTML
This mapping mirrors the one for Perl that passes the content of the
buffer through a program to tidy it (i.e. not merely check but actively
change it).
The tidy(1) option chosen here, -quiet, is the bare minimum to make this
invocation useful. We would never want the boilerplate it otherwise
emits to be in the buffer after a call. Everything else should be
applied in a configuration file, which I'll do in a separate feature.
Diffstat (limited to 'vim/ftplugin/html.vim')
-rw-r--r-- | vim/ftplugin/html.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim index a56ae778..c756eb80 100644 --- a/vim/ftplugin/html.vim +++ b/vim/ftplugin/html.vim @@ -2,6 +2,10 @@ nnoremap <buffer> <silent> <LocalLeader>c \ :write !tidy -errors -quiet<CR> +" Filter buffer through `tidy` +nnoremap <buffer> <silent> <LocalLeader>t + \ :%!tidy -quiet<CR> + " Make a bare URL into a link to itself function! s:UrlLink() |