From 515379435c62d750c8c1f7caa1d9a85a07cc60f8 Mon Sep 17 00:00:00 2001 From: Riley Tomasek Date: Mon, 23 Jan 2017 10:27:52 -0500 Subject: [PATCH] Improve vim integration section (#416) --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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