aboutsummaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorMitermayer Reis <mitermayer.reis@gmail.com>2019-08-25 21:45:33 -0700
committerGitHub <noreply@github.com>2019-08-25 21:45:33 -0700
commite5d758727d1e15ae7075f0b805a372940eeaf84c (patch)
tree348f36737ce5d1a58e956d4e5cef3465c6be050f /ftplugin
parent8601e0090ccbf202c15a151305cdf211e52d8f71 (diff)
parent394f4220f570092486d33ccbed7af7fa8edf21bc (diff)
downloadvim-prettier-e5d758727d1e15ae7075f0b805a372940eeaf84c.tar.xz
Merge pull request #196 from prettier/shore/master-rebasing
Shore/master rebasing
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/html.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/ftplugin/html.vim b/ftplugin/html.vim
new file mode 100644
index 0000000..76ad0af
--- /dev/null
+++ b/ftplugin/html.vim
@@ -0,0 +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 &ft !~# 'markdown'
+ let b:prettier_ft_default_args = {
+ \ 'parser': 'html',
+ \ }
+endif
+
+augroup Prettier
+ autocmd!
+ if g:prettier#autoformat
+ autocmd BufWritePre *.html call prettier#Autoformat()
+ endif
+augroup end