aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2019-09-14 05:38:22 +0000
committermitermayer <mitermayer.reis@gmail.com>2019-09-14 05:38:22 +0000
commit29c1ed25fa649d6f71f6c6bb24a07a262d2f45ca (patch)
tree0702cab37961a0bcf63f0470482d45a70f7b11fd /doc
parent2bc93788e5a48e25ba6ed8f8a46e05cbd65489f3 (diff)
downloadvim-prettier-29c1ed25fa649d6f71f6c6bb24a07a262d2f45ca.tar.xz
making-auto-format-disabled-by-default - Making autoformat disabled by
default - This is a breaking change as on versions 0.x autoformat was enabled by default. This should ensure users dont need to disable autoformat anymore in their vimrc
Diffstat (limited to 'doc')
-rw-r--r--doc/prettier.txt11
1 files changed, 4 insertions, 7 deletions
diff --git a/doc/prettier.txt b/doc/prettier.txt
index 11ed194..c2b38fd 100644
--- a/doc/prettier.txt
+++ b/doc/prettier.txt
@@ -111,9 +111,9 @@ to prettier, this allows for faster formatting but wont preserve indentation.
==============================================================================
CONFIGURATION *vim-prettier-configuration*
-Disable auto formatting of files that have "@format" tag
+Enable auto formatting of files that have "@format" or "@prettier" tag
>
- let g:prettier#autoformat = 0
+ let g:prettier#autoformat = 1
<
Set the prettier CLI executable path
>
@@ -131,24 +131,21 @@ By default we auto focus on the quickfix when there are errors but can also be d
>
let g:prettier#quickfix_auto_focus = 0
<
-To enable vim-prettier to run in files without requiring the "@format" doc tag.
-First disable the default autoformat, then update to your own custom behaviour
+To enable vim-prettier to auto run in files without requiring the "@format" or "@prettier" doc tag.
+First ensure that `g:prettier#autoformat` is not enabled on your `vimrc` (it should be disabled by default), then update to your own custom behaviour
Running before saving sync:
>
- let g:prettier#autoformat = 0
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html Prettier
<
Running before saving async (vim 8+):
>
- let g:prettier#autoformat = 0
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
<
Running before saving, changing text or leaving insert mode:
>
" when running at every change you may want to disable quickfix
let g:prettier#quickfix_enabled = 0
- let g:prettier#autoformat = 0
autocmd BufWritePre,TextChanged,InsertLeave *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
<
Overwrite default prettier configuration