From 374ceec9af29401a183b3be44f5dc75e096abae9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 4 Nov 2017 00:32:44 +1300 Subject: 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. --- vim/ftplugin/html.vim | 4 ++++ 1 file changed, 4 insertions(+) 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 c \ :write !tidy -errors -quiet +" Filter buffer through `tidy` +nnoremap t + \ :%!tidy -quiet + " Make a bare URL into a link to itself function! s:UrlLink() -- cgit v1.2.3