Is there any difference in functionality between these two types of complete-functions in Vimscript?
vim-text-omnicompleteThis plugin automatically sets the omni completion function ( omnifunc ) for files with the text filetype. As such, when editing text files, you will be able to use Ctrl x Ctrl o to show a list of autocomplete suggestions.
Technically, there is no difference in implementation of both
User-defined completion (see :help compl-function
,
:help 'completefunc'
) and Omni completion (see :help compl-omni
,
:help 'omnifunc'
). Both of them work by calling a function of a
special semantics that locates the start of the expression to be
completed at the current position, and provides appropriate completion
suggestions (see :help complete-functions
).
Where the difference between these two types of completion manifests
itself, is the purpose of completion. User-defined completion should
be customized by the user themselves according to conditions specific
to a particular completion idea. Omni completion is supposed to be
filetype-specific. Hence, separate Omni completion functions for
different filetypes are loaded automatically by Vim from
autoload/‹ft›complete.vim
files, where ‹ft›
stands for
a particular filetype. See those Omni completion files for
C or Python filetypes as a reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With