aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-04 08:45:38 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-04 08:45:38 +1300
commitcebbf704f7e3048624bddb2e96eaa1db5fe9ef16 (patch)
treef6caa1ed0d681ffe925c2c7dd46cc9cec00081be /vim/autoload
parentRemove line squeezing function for mail.vim (diff)
downloaddotfiles-cebbf704f7e3048624bddb2e96eaa1db5fe9ef16.tar.gz
dotfiles-cebbf704f7e3048624bddb2e96eaa1db5fe9ef16.zip
Unseat tidy(1) as HTML 'equalprg'
Instead, remap \= specifically to use tidy(1) to reformat the whole buffer.
Diffstat (limited to 'vim/autoload')
-rw-r--r--vim/autoload/html.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/autoload/html.vim b/vim/autoload/html.vim
index c3d99706..e0d47e47 100644
--- a/vim/autoload/html.vim
+++ b/vim/autoload/html.vim
@@ -14,6 +14,13 @@ function! html#UrlLink() abort
endfunction
+" Tidy the whole buffer
+function! html#TidyBuffer() abort
+ let l:view = winsaveview()
+ %!tidy -quiet
+ call winrestview(l:view)
+endfunction
+
" Update a timestamp
function! html#TimestampUpdate() abort
if !&modified