Skip to content
Andrew Hallagan edited this page Apr 15, 2015 · 1 revision

Which autocmd events are exposed by Vim Hooks?

Currently, VimHooks responds to

  • BufAdd
  • BufNew
  • VimEnter
  • VimLeave
  • BufEnter
  • BufLeave
  • BufDelete
  • BufUnload
  • BufWinLeave
  • BufReadPost
  • BufWritePost

Adding others is not difficult, but I thought there could be a negative performance impact if VimHooks was setting up listeners for every Vim autocmd event. I haven't actually tested whether or not this is true because so far my use cases are covered with the few events listed above.

For reference, the full list of all available autocmd events and a description of what triggers each event is available in the Vim documentation or by running :help autocmd-events. If you want to include other events manually you can tweak the plugin by just following the example of what is already in place for BufWritePost, CursorHold, and the other events listed above (you'll find them easily by grepping the code). You can also raise an issue or pull request.

Clone this wiki locally