VimPlugin: vim-go

From wikinotes
Revision as of 17:39, 26 June 2022 by Will (talk | contribs) (Created page with "A standalone LSP setup for golang and vim.<br> includes several refactoring tools as well. = Documentation = <blockquote> {| class="wikitable" |- | <code>:h vim-go</code> || https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt |- |} </blockquote><!-- Documentation --> = Install = <blockquote> <syntaxhighlight lang="vim"> Plug 'https://github.com/fatih/vim-go', { 'do': ':GoUpdateBinaries' } </syntaxhighlight> </blockquote><!-- Install --> = Configuration = <b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A standalone LSP setup for golang and vim.
includes several refactoring tools as well.

Documentation

:h vim-go https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt

Install

Plug 'https://github.com/fatih/vim-go', { 'do': ':GoUpdateBinaries' }

Configuration

coc-go

coc-go and vim-go share a lot of functionality.
Generally, I prefer coc-go, so this disables a lot of vim-go's functionality.

let g:go_code_completion_enabled = 0
let g:go_code_completion_icase =0
let g:go_play_browser_command = $BROWSER.' %URL% &'

Usage

coc-go

Leaving out the parts I like from coc-go, vim-test.

:GoCoverage         " report test coverage, annotate your file
:GocoverageBrowser

:GoErrCheck!        " find unchecked errors in your package

:GoRename foo       " rename an identifier

:GoDebugStart       " open debug ui
:GoDebugStop        " close debug ui

:GoDebugBreakpoint  " toggle breakpoint on line
:GoDebugHalt        " stop debugging