How to Configure Vim as Your Go IDE
Vim/Neovim is my IDE for day-to-day work. My vimrc file can be found here.
This article is all about Vim(not Neovim), and I assume that you have already configured Vim as your code editor.
Okay, let’s get started by installing fatih/vim-go
plugin with your favorite vim plugin manager.
After that, if you have Go installed correctly on your machine already, you will be able to run :GoInstallBinaries
.
Next, install coc.nvim plugin, which is a great language server host for Vim.
For Neovim, I would recommend to use Nvim LSP client, which is more awesome than coc-nvim in my opinion.
Now, you will need a coc.nvim extension called coc-go
, which will serve as your Go language server. It can be done by this vim command: :CocInstall coc-go
.
You can install some other language server extensions along with coc-go
, like coc-tsserver
, coc-json
, etc.
The next step is to configure the installed plugins properly. You can do it just by adding below scripts to your vimrc file:
|
|
SHIFT
+ K
will show documentation for every func you want to know about.
And that’s pretty much it. Try and edit some go
files with your awesome IDE.
Happy coding, Gophers! 😎