Go development environment for Neovim utilizing the builtin LSP and other features and plugins specific to Neovim.
view all screencasts here
- codelens support screencast
- flag and update out-of-date dependencies in your current Go module screencast
- automatically run goimports on save screencast
- auto-highlight the current symbol under the cursor throughout the current buffer screencast
- treesitter navigation utilizing the nvim-treesitter-textobjects plugin
- treesitter text objects utilizing the nvim-treesitter-textobjects plugin
- view Go documentation using the :GoDoc command and Go help with :GoHelp screencast
- manually update imports using the :GoImports command screencast
- use :checkhealth to see if your Goldsmith setup should work correctly screencast
- format your code on demand using :GoFormat or have Goldsmith automatically format your code on save screencast
- run extra linters and/or formatters using null-ls: currently has support for golines, gofmt, gofumpt, revive, golangci-lint, and staticcheck
- see the source of the diagnostic when running extra linters
- Goldsmith can completely configure everything for you, if you want (see the Configurations wiki for more)
- generate test stubs automatically using
- create implementation stubs for your interfaces using :GoImpl screencast
- :GoFillStruct utilizes LSP to fill the current struct
- switch to the ‘alternate’ file quickly screencast
- struct tag editing: add / remove / update struct tags and options screencast
- use common go subcommands from within Neovim with: :GoBuild, :GoInstall, :GoGet, :GoRun, and others
- edit the go.mod file from within Neovim with: :GoModFmt, :GoModTidy, :GoModCheck, :GoModRetract, :GoModReplace, and others
- use the excellent builtin testing framework to run individual tests, package tests, or all your tests, or use the integrated and enhanced testing with vim-test
- all the great Neovim LSP functions are available as Vim commands
- most commands are completely asynchronous
- support for lspinstall and nvim-lsp-installer
Install using your favorite plugin manager.
If you use vim-plug:
Or if you use Vim 8 style packages:
cd <plugin dir> git clone https://github.com/WhoIsSethDaniel/goldsmith.nvim
See the configuration page on the wiki for examples demonstrating how
to configure Goldsmith.
Also see the Goldsmith :help documentation or
after installing Goldsmith by using
These ‘minimal’ requirements are not hard-and-fast. They are simply the minimal versions that the author has been able
to test with. Goldsmith may work just fine with older versions of Go, gopls, etc…. Neovim, however, must be at least
0.5.0 and nvim-lspconfig is also a hard requirement.
Goldsmith will not work with Vim or versions of Neovim prior to 0.5.0.
:checkhealth goldsmith after installing to see what is required and what needs to be done to meet the minimal
[*] Goldsmith depends on package completion provided by gopls. Prior to 0.6.6 this did not exist. If you use a gopls
earlier than 0.6.6 it means package completion will not work for those commands that require it.