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