简体   繁体   中英

Neocomplete does not work with vim files

I just installed Neocomplete and tried it for C files, ruby and python and it works perfectly. I have problems with vim files as I don't get any omnicompletion at all. I tried Cx Co and got omnifunc is not set error

What am I doing wrong? I thought this would work from scratch.

You aren't doing anything wrong. It isn't neocomplete 's job to provide omnifunc .

Neocomplete does work well with omni completion: it uses omnifunc to provide good candidates for completion, along with other completions provided by vim. However, neocomplete itself does not provide or set omnifunc for differnt filetypes. That's why its configuration example has multiple lines with set omnifunc=.. .

It works with python etc. because the corresponding functions are provided by vim runtime files (eg /usr/local/share/vim/vim74/autoload/pythoncomplete.vim ) or other plugins (like jedi-vim ), and the omnifunc options are set accordingly (If you want to know where, try :verbose set omnifunc? ).

Sadly, no function for omni completion for Vim script is provided by default, so you'll need to i) find one and ii) set omnifunc=(that function) . After that, neocomplete will be able to use that function to provide omni completion.


Edit: as @Martin Macak pointed out, neocomplete-vim's github page does show something like omni-completion. After some digging, it seems these completions come from Shougo/neco-vim , mentioned briefly in the doc . i_CTRL-X_CTRL-V mentioned there is also worth trying.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM