<C-x><C-o> returns Pattern not found in C/C++ files even with a ctags file.

  • It used to work and I haven't made any configuration/plugin changes that I know of
  • Starting vim with vim -u NONE -U NONE and manually setting omnifunc=ccomplete#Complete results in the same problem (as does vim --clean), so it doesn't seem to be caused by my vim config
  • Python and HTML omnicomplete still works, so the problem seems to be with the tags file
  • <C-]> and <C-x><C-]> still work and complain when the tags file is removed, so the tags file seems to be fine??
  • I'm using Gutentags with Universal-Ctags in Vim 8.2 to automatically generate the tags file (tried a stock Neovim config as well and still the same error)

Any ideas what the problem could be or how I could go about debugging it?

  • it doesn't seem to be caused by my vim config -u NONE results in skipping all plugins and entering compatible mode. No way your plugin-based completion can work under these circumstances. So your test is totally worthless.
    – Matt
    Jul 1 '20 at 9:37
  • Omnicomplete is a builtin vim feature. Running without vimrc and plugins was to rule those out as causes but thanks for being unnecessarily aggressive I guess?
    – hopibel
    Jul 1 '20 at 10:18
  • @hopibel you could try the --clean flag; also, ctrl-x ctrl-] should complete tags specifically. You may want to see vi.stackexchange.com/q/2003/10604
    – D. Ben Knoble
    Jul 1 '20 at 12:49
  • @D.BenKnoble Same result with --clean, unfortunately. And ctrl-x ctrl-] still works for some reason. For whatever bizarre reason, the only thing that doesn't work is ctrl-x ctrl-o with a tags file.
    – hopibel
    Jul 1 '20 at 13:42

In the end I just gave up and installed the clang-complete plugin, which just worked without any fuss. I get the feeling omni-complete may not do what I think it does. The documentation suggests it should be able to complete struct member names but I simply wasn't able to get it to do so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.