3 homepage: https://github.com/fatih/vim-go
5 vim-go adds Go language support for Vim.
7 `vim-go` provides integration with various official and 3rd part go tooling for linting, vetting, etc.
9 You'll also need `syntastic` or similar.
12 ### How to install by hand
15 git clone --depth=1 https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
18 ### How to configure your `.vimrc`
21 " don't check syntax immediately on open or on quit
22 let g:syntastic_check_on_open = 1
23 let g:syntastic_check_on_wq = 0
25 " we also want to get rid of accidental trailing whitespace on save
26 autocmd BufWritePre * :%s/\s\+$//e
30 """""""""""""""""""""""""""
31 " Golang-specific options "
32 """""""""""""""""""""""""""
34 " tell syntastic that go, golint, and errcheck are installed
35 let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']
37 " tell vim-go that goimports is installed
38 let g:go_fmt_command = "goimports"
40 " tell vim-go to highlight
41 let g:go_highlight_functions = 1
42 let g:go_highlight_methods = 1
43 let g:go_highlight_structs = 1
44 let g:go_highlight_operators = 1
45 let g:go_highlight_build_constraints = 1
48 ### How to install go language tools
52 go get golang.org/x/tools/gopls
55 go get golang.org/x/lint/golint
58 go get github.com/kisielk/errcheck
61 go get github.com/jstemmer/gotags
64 go get golang.org/x/tools/cmd/goimports
67 go get golang.org/x/tools/cmd/gorename
70 go get golang.org/x/tools/cmd/gotype