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 = '📌'