This is my vim configuration for golang
- Install plugged
- Download vimrc
mv ~/.vimrc ~/.vimrc.back
wget -O ~/.vimrc https://raw.githubusercontent.com/momaek/golang-vim/master/vimrc
wget -O ~/.vim/coc-settings.json https://raw.githubusercontent.com/momaek/golang-vim/master/coc-settings.json
- Install plugins
:PlugInstall
- Install vim-go dependencies
:GoInstallBinaries
- Jump to defination:
C+]
, jump back:C+o
- Jump to type-defination
gy
- Jump to references
gr
- Save current
sw
- Force quit
qq
- Normal mode
jj
- Search
/
orspace
- Buffers
C+b
- MRU
C+b
thenC+f
- GoInstall
gi
And more please check vimrc
Install golint
Modify vimrc " golint
" set rtp+=/path/to/your/golint
" autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow
to
set rtp+=/path/to/your/golin
autocmd BufWritePost,FileWritePost *.go execute 'Lint' | cwindow
Install formattag
Modify vimrc " pretty tag
" set rtp+=/path/to/your/formattag
" autocmd BufWritePost,FileWritePost *.go execute 'PrettyTag' | checktime
to
set rtp+=/path/to/your/formattag
autocmd BufWritePost,FileWritePost *.go execute 'PrettyTag' | checktime