Provide Go autocompletion source for asyncomplete.vim via gocode
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-gocode.vim'
call asyncomplete#register_source(asyncomplete#sources#gocode#get_source_options({
\ 'name': 'gocode',
\ 'allowlist': ['go'],
\ 'completor': function('asyncomplete#sources#gocode#completor'),
\ 'config': {
\ 'gocode_path': expand('~/go/bin/gocode')
\ },
\ }))
Note: config
is optional. gocode_path
defaults to gocode
i.e., gocode
binary should exist in the PATH
if config is not specified.