mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-11-09 23:06:38 -05:00
Use tidy for Autoformat with html then remove linebreaks not between tags
This commit is contained in:
parent
f76af68373
commit
8d64e464af
2 changed files with 10 additions and 0 deletions
|
@ -782,6 +782,10 @@
|
|||
autocmd FileType help map <buffer> <silent><expr> <Leader>? ':q<CR>'
|
||||
endif
|
||||
|
||||
"html
|
||||
"after running autoformat, remove linebreaks that aren't between tags
|
||||
autocmd FileType html,xhtml nnoremap <buffer> <silent><expr> <Leader>F ':Autoformat<CR>:%s/\n\s*\([^<\ ]\)/ \1/g<CR>:echo "The document has been formatted with :Autoformat"<CR>'
|
||||
|
||||
"markdown
|
||||
autocmd FileType mkd nnoremap <buffer> <silent><expr> <Leader>F ':TableFormat<CR>'
|
||||
autocmd FileType mkd xnoremap <buffer> <silent><expr> <Leader>F '<Esc>:TableFormat<CR>gv'
|
||||
|
|
|
@ -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 = '📌'
|
||||
|
|
Loading…
Reference in a new issue