Vim comes with the syntaxcomplete plugin that extracts the language keywords from the syntax plugins used for syntax highlighting. You can install this as the omni completion function via
setlocal omnifunc=syntaxcomplete#Complete
and then trigger via <C-x><C-o>
. See :help ft-syntax-omni
for details and how to configure it.
Alternative
If you rather want to maintain the word list yourself, define a Dictionary file via
:set dictionary=/path/to/dict-file
and trigger via <C-x><C-k>
.