diff --git a/README.md b/README.md index fca8f01f3..2ecf660eb 100644 --- a/README.md +++ b/README.md @@ -345,6 +345,21 @@ Then make Neoformat run on save: autocmd BufWritePre *.js Neoformat ``` +#### Other `autocmd` events + +You can also make Vim format your code more frequently, by setting an `autocmd` for other events. Here are a couple of useful ones: + +* `TextChanged`: after a change was made to the text in Normal mode +* `InsertLeave`: when leaving Insert mode + +For example, you can format on both of the above events together with `BufWritePre` like this: + +```vim +autocmd BufWritePre,TextChanged,InsertLeave *.js Neoformat +``` + +See `:help autocmd-events` in Vim for details. + #### Customizing Prettier in Vim If your project requires settings other than the default Prettier settings, you can pass arguments to do so in your `.vimrc` or [vim project](http://vim.wikia.com/wiki/Project_specific_settings), you can do so: