From a91465dfdef9e41995317756240c975c8acc8390 Mon Sep 17 00:00:00 2001 From: Wyatt Anderson Date: Sun, 19 Dec 2021 17:21:53 -0800 Subject: [PATCH] Update instructions for configuring Neoformat (#11946) Co-authored-by: fisker Cheung --- docs/vim.md | 6 ++++++ website/versioned_docs/version-stable/vim.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/vim.md b/docs/vim.md index ed9edb6d7..3e3787f68 100644 --- a/docs/vim.md +++ b/docs/vim.md @@ -17,6 +17,12 @@ The best way to install Neoformat is with your favorite plugin manager for Vim, Plug 'sbdchd/neoformat' ``` +In order for Neoformat to use a project-local version of Prettier (i.e. to use `node_modules/.bin/prettier` instead of looking for `prettier` on `$PATH`), you must set the `neoformat_try_node_exe` option: + +```vim +let g:neoformat_try_node_exe = 1 +``` + Run `:Neoformat` or `:Neoformat prettier` in a supported file to run Prettier. To have Neoformat run Prettier on save: diff --git a/website/versioned_docs/version-stable/vim.md b/website/versioned_docs/version-stable/vim.md index acb611471..18dfb76e7 100644 --- a/website/versioned_docs/version-stable/vim.md +++ b/website/versioned_docs/version-stable/vim.md @@ -18,6 +18,12 @@ The best way to install Neoformat is with your favorite plugin manager for Vim, Plug 'sbdchd/neoformat' ``` +In order for Neoformat to use a project-local version of Prettier (i.e. to use `node_modules/.bin/prettier` instead of looking for `prettier` on `$PATH`), you must set the `neoformat_try_node_exe` option: + +```vim +let g:neoformat_try_node_exe = 1 +``` + Run `:Neoformat` or `:Neoformat prettier` in a supported file to run Prettier. To have Neoformat run Prettier on save: