-1
Daily
-4
Weekly
-4
Monthly
16,213
stars
1,422
forks
247
watchers
1,719
prs
2,025
issues
44
releases
README
vim-go
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.
Lint your code with :GoLint or :GoMetaLinter, run your code through :GoVet to catch static errors, or make sure errors are checked with :GoErrCheck.
Advanced source analysis utilizing gopls, such as :GoImplements, :GoCallees, and :GoReferrers.
... and many more! Please see doc/vim-go.txt for more information.
Integration with gopls.
The gopls instance can be shared with other Vim plugins.
Vim-go's use of gopls can be disabled and alternative tools can be used when desired.
Integration with Tagbar via gotags.
Integration with Ultisnips and other snippet engines.
Install
vim-go requires at least Vim 8.2.5072 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
Neovim packages
git clone https://github.com/fatih/vim-go.git ~/.local/share/nvim/site/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 install 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 a tutorial in the official vim-go wiki.
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 nTop issues
#3432Vim/NVim freeze with GoDebugStop with Telepresence V211 comments · 2022-07-20#3701gopls v0.18.0 deprecated hoverKind=Structured10 comments · 2025-02-21#3447mingw: Incompatible with mingw6410 comments · 2022-08-30#3600debugger stops in assembler code file 9 comments · 2023-11-17#3631Error in identifier/syntax prevents autocommands to be executed7 comments · 2024-01-13#3602mingw: GoDef (and various other commands) don't work, potentially due to pathing issue7 comments · 2023-11-19#2245:GoBuild is slower than expected when rebuilding binaries7 comments · 2019-04-27#1431Independent stacks for each vim window when using GoDef7 comments · 2017-09-07
Latest release
v1.29 v1.29 2025-04-20Please checkout the changelog for this release. The full list of changes in this version are on the v1.29 milestone Do you want to support vim-go? Checkout the fully optional donation option, a way to support vim-go's ongoing development directly: https://www.patreon.com/bhcleek.