Error in Vim with autocmd: No matching autocommands

Tag: vim , clang , code-completion Author: franky_816 Date: 2011-10-09

I'm using the Vim plugin clang_complete and I want to update the compilation errors in the QuickFix window whenever I save the file. So as the doc says, I must call the function g:ClangUpdateQuickFix().

The thing is that the next autocmd gives me the next message whenever it is executed despite it seems to work:

No matching autocommands

The autocmd I use is:

autocmd BufWritePost *.c,*.cpp,*.cxx,*.cc call g:ClangUpdateQuickFix()

What is the meaning of that message?

Other Answer1

The displayed message come from clang_complete itself. Some vim plugins (not clang_complete) are reparsing the quickfix window whenever it changes. Fortunately, vim provide an autocmd for that: QuickFixCmdPost, so these plugins are using this to reparse the quickfix messages.

In clang_complete, since we're modifiying the quickfix window and we don't want to break existing plugins, we need to trigger this autocmd manually. What you get is the No matching autocommands message when you don't use those plugins.