diff options
| author | mitermayer <mitermayer.reis@gmail.com> | 2020-02-15 09:49:17 +0000 |
|---|---|---|
| committer | mitermayer <mitermayer.reis@gmail.com> | 2020-02-15 09:49:17 +0000 |
| commit | 66c1a7c8fcba6ef118469e0845ddd8638069d35a (patch) | |
| tree | 9c4e41a1c0cec3f49f3e53b7a83c3dc7dc2f5f0f /ftplugin | |
| parent | 8373441047299fbe528dfda528fa01a4971e7d23 (diff) | |
| download | vim-prettier-66c1a7c8fcba6ef118469e0845ddd8638069d35a.tar.xz | |
Added support for prettier xml plugin
- updated package.json deps
- added tests
- updated lock file
Diffstat (limited to 'ftplugin')
| -rw-r--r-- | ftplugin/html.vim | 2 | ||||
| -rw-r--r-- | ftplugin/xml.vim | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ftplugin/html.vim b/ftplugin/html.vim index 4d37544..c0c39b4 100644 --- a/ftplugin/html.vim +++ b/ftplugin/html.vim @@ -1,6 +1,6 @@ " 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 &ft ==# 'html' +if expand("%:e") ==# 'html' let b:prettier_ft_default_args = { \ 'parser': 'html', \ } 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 |
