omnifunc

40 views
Skip to first unread message

Chiel ten Brinke

unread,
Aug 17, 2012, 9:36:59 AM8/17/12
to vim...@googlegroups.com
Small question:

If I want to enable onmicompletion for javascript, what is the difference between these two:
"set ofu=javascriptcomplete#CompleteJS"
and
"set ofu=syntaxcomplete#Complete"?

Kind regards

Ben Fritz

unread,
Aug 17, 2012, 11:03:50 AM8/17/12
to vim...@googlegroups.com
They're using two completely different completion functions.

The first looks like it is a script designed for working with javascript.

The second is a generic "scan the syntax file for keyword definitions" completion method. See :help ft-syntax-omni. You probably want to use the first, as the second is more of a fallback if there's nothing better available.

Chiel ten Brinke

unread,
Aug 17, 2012, 11:08:43 AM8/17/12
to vim...@googlegroups.com
With a bit of help from guys in the IRC channel, I found out that "set ofu=javascriptcomplete#CompleteJS" is set by default au ft=js, by $VIMRUNTIME/ftplugin/javascript.vim. Thus it is not necessary at all to set ofu in vimrc.

Ben Fritz

unread,
Aug 17, 2012, 1:47:42 PM8/17/12
to vim...@googlegroups.com
On Friday, August 17, 2012 10:08:43 AM UTC-5, Chiel92 wrote:
> With a bit of help from guys in the IRC channel, I found out that "set ofu=javascriptcomplete#CompleteJS" is set by default au ft=js, by $VIMRUNTIME/ftplugin/javascript.vim. Thus it is not necessary at all to set ofu in vimrc.
>

Correct. But that's not what you asked.
Reply all
Reply to author
Forward
0 new messages