I recently installed vim-go using pathogen, but the autocompletion feature is not working. If I am using it only shows commands I've already used. My .vimrc has
filetype plugin on
" Enable autocompletion
set omnifunc=syntaxcomplete#Complete
" Select keyword as you type
:set completeopt=longest,menuone
Do I need more than just this plugin? The other feature I have tested so far are working (:GoRun, syntax highlighting). This is on a Ubuntu machine.
document. and press *Ctrl + x* followed by *Ctrl + o* to see the auto-complete suggestions as below. This is how you can enable and use the auto-complete feature of Vim editor to write Javascript programs.
And if you want to dismiss the list and not have it autocomplete anything, hit Ctrl+E .
Are you typing C-X C-O to open the autocompletation window? This works fine for me.
On the other hand, if you want to get real-time completion (completion by type) install the following plugins YCM
or neocomplete
The syntaxcomplete#Complete
ships with Vim, not the Go filetype plugin, and it has very limited capabilities (basically, just offering the language's keywords). No wonder you're disappointed.
The ftplugin/go.vim
file sets the correct, custom completion of the vim-go plugin:
setlocal omnifunc=go#complete#Complete
So, just ensure that the 'filetype'
setting is correct (go
), and that you don't have any additional configuration that overrides the plugin's.
:verbose setlocal omnifunc?
can tell you.
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