How to Setup Prettier with Vim

Prettier is a helpful tool for auto formatting front end (JS, HTML, CSS, etc) code. I have it installed as an extension in VS Code, but it can also be used in Vim. Below are the steps to follow:

If using Pathogen as a plugin manager, run the following commands:

Change into the installed plugin directory, and run either:

yarn install

Or:

npm install

To install the dependencies.

Then simply update your .vimrc file with the following two lines of code:

And you should be good to go!