diff --git a/README.md b/README.md index 7928dc7a..832c6e6d 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,12 @@ autocmd FileType javascript set formatprg=prettier\ --stdin ``` This makes Prettier power the [`gq` command](http://vimdoc.sourceforge.net/htmldoc/change.html#gq) -for automatic formatting without any plugins. +for automatic formatting without any plugins. You can also add the following to your +`.vimrc` to run prettier when `.js` files are saved: + +``` +autocmd BufWritePre *.js :normal gggqG +``` ### Visual Studio Code