3 homepage: https://github.com/fatih/vim-go
5 vim-go adds Go language support for Vim.
16 > `vim-go` provides integration with various official and 3rd part go tooling
17 > for linting, vetting, etc.
19 You'll also need `ALE`, [`syntastic`](https://webinstall.dev/vim-syntastic), or
22 ### How to install by hand
25 git clone --depth=1 https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
28 ### How to configure your `.vimrc`
31 " don't check syntax immediately on open or on quit
32 let g:syntastic_check_on_open = 1
33 let g:syntastic_check_on_wq = 0
35 " we also want to get rid of accidental trailing whitespace on save
36 autocmd BufWritePre * :%s/\s\+$//e
40 """""""""""""""""""""""""""
41 " Golang-specific options "
42 """""""""""""""""""""""""""
44 " tell syntastic that go, golint, and errcheck are installed
45 let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']
47 " tell vim-go that goimports is installed
48 let g:go_fmt_command = "goimports"
50 " tell vim-go to highlight
51 let g:go_highlight_functions = 1
52 let g:go_highlight_methods = 1
53 let g:go_highlight_structs = 1
54 let g:go_highlight_operators = 1
55 let g:go_highlight_build_constraints = 1
58 ### How to install go language tools
62 go get golang.org/x/tools/gopls
65 go get golang.org/x/lint/golint
68 go get github.com/kisielk/errcheck
71 go get github.com/jstemmer/gotags
74 go get golang.org/x/tools/cmd/goimports
77 go get golang.org/x/tools/cmd/gorename
80 go get github.com/sqs/goreturns
83 go get golang.org/x/tools/cmd/gotype