kristijanhusak / vim-dadbod-completion

Database autocompletion powered by https://github.com/tpope/vim-dadbod

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

omnifunc not working

gegnew opened this issue · comments

or perhaps I am not understanding correctly.

Here's what I have done:

In init.nvim

Plug 'tpope/vim-dadbod'
Plug 'kristijanhusak/vim-dadbod-ui'
Plug 'kristijanhusak/vim-dadbod-completion'

autocmd FileType sql setlocal omnifunc=vim_dadbod_completion#omni

Then I open vim vim and :DBUI, then try to autocomplete with omnifunc <C-x><C-o.

I get a warning: SQLComplete:The dbext plugin must be loaded for dynamic SQL completion

What have I missed?

What do you get when you you do :echo &omnifunc before you try to do autocompletion?

vim_dadbod_completion#omni

For some reason, ignoring this for two weeks has solved the problem. I'm not entirely sure what change in my init.vim could have helped...

According to the warning you got, omnifunc was not set properly, it used the default one. If you get the same or similar error, double check if it's properly set. If it's working now, i'm closing this.