diff options
Diffstat (limited to 'vim/after/ftplugin/html')
-rw-r--r-- | vim/after/ftplugin/html/tidy.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vim/after/ftplugin/html/tidy.vim b/vim/after/ftplugin/html/tidy.vim index e0c43f01..5a8ded7e 100644 --- a/vim/after/ftplugin/html/tidy.vim +++ b/vim/after/ftplugin/html/tidy.vim @@ -20,6 +20,13 @@ let b:did_ftplugin_html_tidy = 1 let b:undo_ftplugin = b:undo_ftplugin \ . '|unlet b:did_ftplugin_html_tidy' +" Plugin function +function s:HtmlTidy() + let l:view = winsaveview() + %!tidy -quiet + call winrestview(l:view) +endfunction + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_html_maps') finish @@ -28,7 +35,7 @@ endif " Define a mapping target nnoremap <buffer> <silent> <unique> \ <Plug>HtmlTidy - \ :<C-U>%!tidy -quiet<CR> + \ :<C-U>call <SID>HtmlTidy()<CR> let b:undo_ftplugin = b:undo_ftplugin \ . '|nunmap <buffer> <Plug>HtmlTidy' |