From 66c1a7c8fcba6ef118469e0845ddd8638069d35a Mon Sep 17 00:00:00 2001 From: mitermayer Date: Sat, 15 Feb 2020 09:49:17 +0000 Subject: Added support for prettier xml plugin - updated package.json deps - added tests - updated lock file --- ftplugin/xml.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ftplugin/xml.vim (limited to 'ftplugin/xml.vim') diff --git a/ftplugin/xml.vim b/ftplugin/xml.vim new file mode 100644 index 0000000..70aec32 --- /dev/null +++ b/ftplugin/xml.vim @@ -0,0 +1,14 @@ +" markdown/php files run this as well +" https://stackoverflow.com/questions/22839269/why-does-vim-default-markdown-ftplugin-source-html-ftplugins-is-there-any-ways +if expand("%:e") ==# 'xml' + let b:prettier_ft_default_args = { + \ 'parser': 'xml', + \ } +endif + +augroup Prettier + autocmd! + if get(g:, 'prettier#autoformat') + autocmd BufWritePre *.xml call prettier#Autoformat() + endif +augroup end -- cgit v1.3