Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

Undefined function pythoncomplete#Complete #509

Closed xzwj closed 6 years ago

xzwj commented 6 years ago

when I use ".\", I got an error: function neocomplcache#handler #_do_auto_complete[55] .. neocomplcache#complete#set_results_pos[32] ..437[8]..193_set_complete_results_pos function neocomplcache#handler #_do_auto_complete[55]..neocomplcache#complete#set_Vim(let):E117: undefined function:pythoncomplete#Complete

I check :echo has('python') returns 0 and setl omnifunc returns omnifunc=pythoncomplete#Complete, but :echo has('python3') returns 1

I usually use vim edit python3, and occasionally edit python2. how can I fix it?

Shougo commented 6 years ago

In Python3 only environment, autocmd FileType python setlocal omnifunc=pythoncomplete#Complete is needed.

I usually use vim edit python3, and occasionally edit python2. how can I fix it?

You should use Python3 complete instead.

xzwj commented 6 years ago

Hey, Shougo. I have added autocmd FileType python setlocal omnifunc=pythoncomplete#Complete in .vimrc. but it have no effect. I have just started learning vim. could you tell me more detailed? Thank you!

Shougo commented 6 years ago

Oh, I had mistake.

autocmd FileType python setlocal omnifunc=python3complete#Complete
xzwj commented 6 years ago

Fixed! Thank you again :)