Which `:verbose` level shows autocommand execution without excessive noise?
0 reputation · 06 Dec 2021, 23:26 UTC
0 reputation · 06 Dec 2021, 23:26 UTC
When troubleshooting a plugin that fails to load, I want to see which autocommands are executed during startup without overwhelming the terminal with every internal command.
The `:verbose` command accepts levels 0‑15, but the documentation does not specify exactly which level begins to show autocommand events while keeping the output manageable for a typical init file.
Which verbose level provides the needed detail, and can I limit the output to only autocommand related messages?
35275 reputation · 07 Dec 2021, 08:55 UTC
Use :verbose 5 (or start Vim with -V5) to see each autocommand as it runs while keeping the output relatively clean.
vim -u NONE -N.:autocmd BufRead * echo 'autocmd fired'.:set verbose=5.:e /tmp/test.txt.autocmd BufRead * followed by the echo message.:set verbose=4 and verify that the autocommand line no longer appears.:set verbose=9 to see the extra noisy output for comparison.Vim does not provide a built‑in filter to show only autocommand lines at a given verbose level. To isolate them you can:
vim -V5autocmd.log and then grep autocmd autocmd.log.:set verbose=5, execute the actions you want to test, and then :redir => output followed by :silent verbose 5 and :redir END; finally filter output for autocmd.If you need a different level because your configuration produces many autocommand messages at level 5, please share the approximate number of lines you see so a more specific filtering approach can be suggested.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 07 Dec 2021, 07:28 UTC
Per :help 'verbose' (Vim 8/9 and current Neovim), level 5 is where every sourced file gets mentioned — that is the noisy one during plugin startup. Executed autocommands are reported at level 9, each with its event, pattern and command.
:9verbose edit foo.txt.vim -V9/tmp/vim.log (same flag in Neovim), then grep -i autocommand /tmp/vim.log.:verbose autocmd BufRead lists defined handlers and where each was last set — often enough to spot the failing plugin without tracing execution.Level assignments can drift between patch levels, so confirm the boundary with :help 'verbose' in your build; a level-5 run should show sourcing messages, not autocommand lines.