From 0241700d62814a1ddafc0227e0c66e9a8e3fae87 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Thu, 6 Aug 2020 08:27:32 -0400 Subject: [PATCH] Add buffer-level prettier exec command to doc --- doc/prettier.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/prettier.txt b/doc/prettier.txt index b56f6e1..e9cf496 100644 --- a/doc/prettier.txt +++ b/doc/prettier.txt @@ -158,6 +158,17 @@ Running before saving, changing text or leaving insert mode: let g:prettier#quickfix_enabled = 0 autocmd BufWritePre,TextChanged,InsertLeave *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync < +Buffer-level custom commands + +To use an alternative command, like `prettier-stylelint`, set this at the +buffer level with `b:prettier_exec_cmd`, e.g.: +> + au FileType css,scss let b:prettier_exec_cmd = "prettier-stylelint" +< +vim-prettier will look for the executable in the same places it looks for +`prettier`, and will fall back to `prettier` if it can't find +`b:prettier_exec_cmd` + Overwrite default prettier configuration **Note:** vim-prettier default settings differ from prettier intentionally.