X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=vim-go%2FREADME.md;fp=vim-go%2FREADME.md;h=ebabbd2fa33b184e59790b503b1cd5ca46ffed8d;hb=85a231cc55e039a7e99a5a853a7d7ad8519fa596;hp=0000000000000000000000000000000000000000;hpb=4b52c1ba76242bc0e80fa15a37729fe248364343;p=webi-installers%2F.git diff --git a/vim-go/README.md b/vim-go/README.md new file mode 100644 index 0000000..ebabbd2 --- /dev/null +++ b/vim-go/README.md @@ -0,0 +1,71 @@ +--- +title: vim-go +homepage: https://github.com/fatih/vim-go +tagline: | + vim-go adds Go language support for Vim. +description: | + `vim-go` provides integration with various official and 3rd part go tooling for linting, vetting, etc. + + You'll also need `syntastic` or similar. +--- + +### How to install by hand + +```bash +git clone --depth=1 https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go +``` + +### How to configure your `.vimrc` + +```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 +``` + +```vimrc +""""""""""""""""""""""""""" +" 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 + +```bash +# gopls +go get golang.org/x/tools/gopls + +# golint +go get golang.org/x/lint/golint + +# errcheck +go get github.com/kisielk/errcheck + +# gotags +go get github.com/jstemmer/gotags + +# goimports +go get golang.org/x/tools/cmd/goimports + +# gorename +go get golang.org/x/tools/cmd/gorename + +# gotype +go get golang.org/x/tools/cmd/gotype +```