shi70
shi70

Reputation: 23

Default Omnicomplete support

I just enabled omnicomplete function(I'm using Vim7.3) and I want to try it out so I wrote a test.c:

int main
{
   int appleInc;
   app_
}

"_"is where the current cursor is.But when I hit Ctrl X or Ctrl O, nothing pops up. It just say pattern not found.

I'm a bit confused by this. Doesn't it at least supposed to support the variable autocompletion? This is what I add in the .vimrc:

filetype plugin on
ofu=syntaxcomplete#Complete

Upvotes: 1

Views: 1687

Answers (1)

romainl
romainl

Reputation: 196476

The correct shortcut for omnicompletion is <C-x><C-o> that's <C-x> then <C-o>.

In this case, you want <C-n>/<C-p> to complete with a keyword from the current buffer and other sources or <C-x><C-n>/<C-x><C-p> to complete with a keyword from the current buffer only.

See :help ins-completion.

Upvotes: 1

Related Questions