简体   繁体   中英

Vim Prettier with vim Plug

I tried installing Prettier with vim plug but doesn't work. PlugInstall installs successfully without any errors. but:prettier command says it's not a command

vimrc:

Plug 'prettier/vim-prettier', { 'do': 'yarn install' }

Thank You:D

From Vim prettier docs

Install with vim-plug, assumes node and yarn|npm installed globally.

So make sure that you have those dependencies installed in your system.

Also use :Prettier , note the first character is in uppercase.

I think you just have to add this line to your.vimrc

let g:prettier#exec_cmd_path = "~/path/to/cli/prettier"

To know the path you must go to your vim-prettier directory and enter to package.json (for example) and use this command

:PrettierCliPath

Finally, copy and paste the path to your.vimrc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM