Go development plugin for Vim
This plugin adds Go language support for Vim, with the following main features:
:GoBuild, install it with
:GoInstallor test it with
:GoTest. Run a single test with
:GoTestFunc).
:GoRun.
delvesupport with
:GoDebugStart.
gopls.
:GoDef.
:GoDocor
:GoDocBrowser.
:GoImport, remove them via
:GoDrop.
:GoRename.
:GoCoverage.
:GoAddTagsand
:GoRemoveTags.
golangci-lintwith
:GoMetaLinterto invoke all possible linters (
golint,
vet,
errcheck,
deadcode, etc.) and put the result in the quickfix or location list.
:GoLint, run your code through
:GoVetto catch static errors, or make sure errors are checked with
:GoErrCheck.
guru, such as
:GoImplements,
:GoCallees, and
:GoReferrers.
goplsinstance can be shared with other Vim plugins.
goplscan be disabled.
vim-go requires at least Vim 8.0.1453 or Neovim 0.4.0.
The latest stable release is the recommended version to use. If you choose to use the master branch instead, please do so with caution; it is a development branch.
vim-go follows the standard runtime path structure. Below are some helper lines for popular package managers:
git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plugin 'fatih/vim-go'
You will also need to install all the necessary binaries. vim-go makes it easy to install all of them by providing a command,
:GoInstallBinaries, which will
go getall the required binaries.
Check out the Install section in the documentation for more detailed instructions (
:help go-install).
The full documentation can be found at doc/vim-go.txt. You can display it from within Vim with
:help vim-go.
Depending on your installation method, you may have to generate the plugin's
help tagsmanually (e.g.
:helptags ALL).
We also have an official vim-go tutorial.
The FAQ and troubleshooting tips are in the documentation and can be quickly accessed using
:help go-troubleshooting. If you believe you've found a bug or shortcoming in vim-go that is neither addressed by help nor in existing issues, please open an issue with clear reproduction steps.
:GoReportGitHubIssuecan be used pre-populate a lot of the information needed when creating a new issue.
All PRs are welcome. If you are planning to contribute a large patch or to integrate a new tool, please create an issue first to get any upfront questions or design decisions out of the way first.
You can run the tests locally by running
make. It will lint the VimL for you, lint the documentation, and run the tests against the minimum required version of Vim, other versions of Vim that may be critical to support, and Neovim.
The BSD 3-Clause License - see
LICENSEfor more details