diff options
| author | mitermayer <mitermayer@gmail.com> | 2020-02-05 10:51:34 +1100 |
|---|---|---|
| committer | mitermayer <mitermayer@gmail.com> | 2020-02-05 10:52:00 +1100 |
| commit | a96e7127bce7cda55c4c9848a3dbf78645565930 (patch) | |
| tree | cf856d77c9960a09eb3156937aa1b896b855bed6 /ftplugin/html.vim | |
| parent | f4e31d67aa1e0658c1a19a26e4bad9fc4691eab9 (diff) | |
| download | vim-prettier-a96e7127bce7cda55c4c9848a3dbf78645565930.tar.xz | |
release/1.x - Bringing back filetype definitions
Diffstat (limited to 'ftplugin/html.vim')
| -rw-r--r-- | ftplugin/html.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ftplugin/html.vim b/ftplugin/html.vim index 58ab258..e27828a 100644 --- a/ftplugin/html.vim +++ b/ftplugin/html.vim @@ -1,7 +1,14 @@ " markdown files run this as well " https://stackoverflow.com/questions/22839269/why-does-vim-default-markdown-ftplugin-source-html-ftplugins-is-there-any-ways -if &filetype !~# 'markdown' +if &ft !~# 'markdown' let b:prettier_ft_default_args = { \ 'parser': 'html', \ } endif + +augroup Prettier + autocmd! + if get(g:, 'prettier#autoformat') + autocmd BufWritePre *.html call prettier#Autoformat() + endif +augroup end |
