From 8d64e464af72bb6099ed7eca46125f421b2c6dc7 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Mon, 5 Jan 2015 20:53:42 -0500 Subject: [PATCH] Use tidy for Autoformat with html then remove linebreaks not between tags --- vim/config/keyboard.vim | 4 ++++ vim/config/plugins.vim | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 6169b0e..32e93ba 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -782,6 +782,10 @@ autocmd FileType help map ? ':q' endif + "html + "after running autoformat, remove linebreaks that aren't between tags + autocmd FileType html,xhtml nnoremap F ':Autoformat:%s/\n\s*\([^<\ ]\)/ \1/g:echo "The document has been formatted with :Autoformat"' + "markdown autocmd FileType mkd nnoremap F ':TableFormat' autocmd FileType mkd xnoremap F ':TableFormatgv' diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim index 18bcce3..b02abf6 100644 --- a/vim/config/plugins.vim +++ b/vim/config/plugins.vim @@ -34,6 +34,12 @@ scriptencoding utf-8 set tags=./.tags;,~/.vim/tags "}}} +"AUTOFORMAT: {{{ + "use tidy for html instead of html-beautify + let g:formatprg_html = "tidy" + let g:formatprg_args_expr_html = '"-q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -ashtml -wrap ".&textwidth' +"}} + "BOOKMARKS: {{{ let g:bookmark_sign = '★' let g:bookmark_annotation_sign = '📌'