Skip to content
Go development plugin for Vim
Vim script Go Vim Snippet Shell Python Dockerfile Makefile
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github use the docker cache more frequently May 25, 2020
assets Remove unused screenshot.png (#1635) Jan 4, 2018
autoload remove g:go_doc_popup_border May 28, 2020
compiler adjust default errorformat Sep 10, 2019
doc remove g:go_doc_popup_border May 28, 2020
ftdetect refactor autocmd events Jan 5, 2019
ftplugin Merge pull request #2741 from woodstok/GoImplementsLsp Mar 29, 2020
gosnippets snippets: add fmt.Errorf error wrapping snippets May 9, 2020
indent Restore &cpo even when finishing early Dec 11, 2018
plugin fixes errormessage when detecting a neovim version < 0.4.0 Apr 27, 2020
rplugin/python3/denite/source Add support for denite.nvim about :GoDecls / :GoDeclsDir (#1604) Dec 10, 2017
scripts use the docker cache more frequently May 25, 2020
syntax fmt: preserve gopls diagnostic highlighting Mar 19, 2020
templates Use a different template for test files Jun 6, 2017
test don't spam users when Vim is started with Vi compatibility mode Nov 16, 2018
.codecov.yml do not report patch codecoverage Sep 2, 2018
.coveragerc update coverage data file location Jul 22, 2018
.dockerignore ignore invalid channel ids when stopping gopls Apr 12, 2020
.editorconfig Add scripts/docker-test (#1550) Nov 4, 2017
.gitignore disable viminfo in tests Apr 18, 2020
.vintrc.yaml Add some VimScript lint tools (#1558) Nov 16, 2017
CHANGELOG.md update CHANGELOG.md for #2900 May 28, 2020
Dockerfile use the docker cache more frequently May 25, 2020
LICENSE Fix whitespace and typo (#1201) Feb 17, 2017
Makefile use the docker cache more frequently May 25, 2020
README.md require Neovim v0.4.0 Apr 24, 2020
addon-info.json vim-go: remove misc/vim notes Sep 8, 2014

README.md

vim-go Build Status GitHub Actions Status

Vim-go logo

Features

This plugin adds Go language support for Vim, with the following main features:

  • Compile your package with :GoBuild, install it with :GoInstall or test it with :GoTest. Run a single test with :GoTestFunc).
  • Quickly execute your current file(s) with :GoRun.
  • Improved syntax highlighting and folding.
  • Debug programs with integrated delve support with :GoDebugStart.
  • Completion and many other features support via gopls.
  • formatting on save keeps the cursor position and undo history.
  • Go to symbol/declaration with :GoDef.
  • Look up documentation with :GoDoc or :GoDocBrowser.
  • Easily import packages via :GoImport, remove them via :GoDrop.
  • Precise type-safe renaming of identifiers with :GoRename.
  • See which code is covered by tests with :GoCoverage.
  • Add or remove tags on struct fields with :GoAddTags and :GoRemoveTags.
  • Call golangci-lint with :GoMetaLinter to invoke all possible linters (golint, vet, errcheck, deadcode, etc.) and put the result in the quickfix or location list.
  • Lint your code with :GoLint, run your code through :GoVet to catch static errors, or make sure errors are checked with :GoErrCheck.
  • Advanced source analysis tools utilizing guru, such as :GoImplements, :GoCallees, and :GoReferrers.
  • ... and many more! Please see doc/vim-go.txt for more information.
  • The gopls instance can be shared with other Vim plugins.
  • Vim-go's use of gopls can be disabled.

Install

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:

  • Vim 8 packages
    • git clone https://github.com/fatih/vim-go.git ~/.vim/pack/plugins/start/vim-go
  • Pathogen
    • git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
  • vim-plug
    • Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
  • Vundle
    • 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 get all the required binaries.

Check out the Install section in the documentation for more detailed instructions (:help go-install).

Usage

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 tags manually (e.g. :helptags ALL).

We also have an official vim-go tutorial.

FAQ and troubleshooting

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. :GoReportGitHubIssue can be used pre-populate a lot of the information needed when creating a new issue.

Contributing

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.

License

The BSD 3-Clause License - see LICENSE for more details

You can’t perform that action at this time.