vim-go adds Go language support for Vim.

Updating vim-go

webi vim-go

Cheat Sheet

vim-go provides integration with various official and 3rd part go tooling for linting, vetting, etc.

You'll also need ALE, syntastic, or similar.

How to install by hand

git clone --depth=1 ~/.vim/pack/plugins/start/vim-go

How to configure your .vimrc

" don't check syntax immediately on open or on quit
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

" we also want to get rid of accidental trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
" Golang-specific options "

" tell syntastic that go, golint, and errcheck are installed
let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']

" tell vim-go that goimports is installed
let g:go_fmt_command = "goimports"

" tell vim-go to highlight
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1

How to install go language tools

# gopls
go get

# golint
go get

# errcheck
go get

# gotags
go get

# goimports
go get

# gorename
go get

# goreturns
go get

# gotype
go get


Report an Issue Submit Installer