I think we should use the syntaxcomplete function which allow one to omnicomplete keywords based on a filetype's syntax file. The patch I propose comes from vim's help (:help ft-syntax-omni) and checks if a specific plugin set the completion, if not, then it sets completion based on syntax file. For example, it would allow ebuild developpers to complete "pk" into pkg_postinstall, pkg_preinstall etc using i-CTRL-x_CTRL-o and we don't have to provide a $VIMRUNTIME/ebuildcomplete.vim file.
Created attachment 240407 [details, diff] /etc/vim/vimrc patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc69009cc7aef4420b844bc199abfe5285b6e0d4 commit cc69009cc7aef4420b844bc199abfe5285b6e0d4 Author: Patrice Clement <monsieurp@gentoo.org> AuthorDate: 2017-10-22 14:03:05 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2017-10-22 14:25:42 +0000 app-editors/vim-core: enable omni completion based on syntax files. Closes: https://bugs.gentoo.org/330187 Courtesy of Florian Crouzat <gentoo@floriancrouzat.net> Package-Manager: Portage-2.3.8, Repoman-2.3.3 app-editors/vim-core/files/vimrc-r5 | 11 +++++++++++ 1 file changed, 11 insertions(+)