I am trying to set up syntax keyword based omnicompletion in vim.
I have defined a few syntax keyword Constant
s in ~/.config/nvim/syntax/spl.vim
They are correctly detected and highlighted.
They are also showing up in :syntax list
as below:
:syntax list
--- Syntax items ---
Operator xxx match #[=+\-*\/%]#
String xxx match /".*"/
Comment xxx match +\/\/.*+
Constant xxx SWAP_OUT FREE_PAGE_TABLE INT_CLOSE DISK_SIZE GET_CODE_PAGE IDLE_PROCESS INT_LOGOUT
CONTEXT_SWITCH MAX_FILE_SIZE INT_DELETE WAIT_TERMINAL INIT_PROCESS MAX_BUFFER
RESOURCE_TABLE_OFFSET PAGE_SIZE INODE_TABLE WAIT_DISK FILE
.. truncated ..
:set omnifunc
outputs omnifunc=syntaxcomplete#Complete
But still Ctrl+X Ctrl+O shows Omni completion (^O^N^P) Pattern not found
How to fix this?
Vim version is: NVIM v0.4.2
set ft?
filetype=spl
scriptnames
...
ftdetect/spl.vim
syntax/spl.vim
...
:set filetype?
and:scriptnames
give what you expect. – D. Ben Knoble♦ Nov 4 '19 at 12:39:set filetype?
givesfiletype=spl
and:scriptnames
containsftdetect/spl.vim
andsyntax/spl.vim
, which are expected values. – happycoder97 Nov 4 '19 at 13:57