Debugging window autocommands
From Vim Tips Wiki
created 2002 · complexity advanced · author Hari Krishna Dara · version 6.0
Don't know how people debug autocommands, but I just found out that you can debug (at least) those that result due to window close by just doing a debug quit, i.e.,
Vim will let you step into the autocommands. Try it to believe.
While going through the help pages, I figured this feature is documented with the following example:
:debug edit <file>
This should let you debug autocommands that get triggered by loading a new buffer.
There's also the :verbose command, with which you can specify the verbosity level for one command only:
:9verbose edit somefile.txt.gz
The verbose levels are documented in :help 'verbose'. The 'verbose' option variable sets verbosity permamently, not just for one command only.