This plugin adds Go language support for Vim, with the following main features:
- Compile your package with
:GoBuild, install it with:GoInstallor 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
delvesupport 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
:GoDocor: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
:GoAddTagsand:GoRemoveTags. - Lint your code with
:GoLintor:GoMetaLinter, run your code through:GoVetto 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
goplsinstance can be shared with other Vim plugins. - Vim-go's use of
goplscan be disabled and alternative tools can be used when desired. - Integration with
Tagbarviagotags. - Integration with
Ultisnipsand other snippet engines.
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
