Vim-go autocomplete not working

I recently installed vim-go using a pathogen, but the autocomplete function does not work. If I use it, only the commands that I have already used are displayed. 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? Another function I've tested so far is working (: GoRun, syntax highlighting). This is located on a Ubuntu machine.

+4
source share
2 answers

syntaxcomplete#Completecomes with Vim, not with the Go filetype plugin, and has very limited capabilities (basically, it just offers language keywords). No wonder you're disappointed.

ftplugin/go.vim , vim-go:

setlocal omnifunc=go#complete#Complete

, , 'filetype' (go), , .

:verbose setlocal omnifunc?

.

+4

C-X C-O, ? .

, ( ), YCM neocomplete

+4

Source: https://habr.com/ru/post/1543697/


All Articles