Skip to content

Instantly share code, notes, and snippets.

@rmasci
Last active April 21, 2023 15:49
Show Gist options
  • Save rmasci/1bb7342aaf6a8818de3e5e7118e10493 to your computer and use it in GitHub Desktop.
Save rmasci/1bb7342aaf6a8818de3e5e7118e10493 to your computer and use it in GitHub Desktop.
NvChad install with Go Language server support

Install NVChad for Go

Installning NvChad (nvim ide) with support for Go Language Server (gopls). This worked for me (on a mac) and it's very easy. Wish I had known this BEFORE spending hours googling and searching for how to add Gopls support.

Steps

Follow steps to install nvim. Once nvim is installed run these commands:

rm -rf ~/.config/nvim
rm -rf ~/.local/share/nvim
rm -rf ~/.cache/nvim
git clone https://github.com/NvChad/NvChad.git ~/.config/nvim
nvim

This will install NvChad, when you get to a screen that says:

When it askes you:

Do you want to install example custom config? (y/N) :

Type y and hit enter -- we'll need this custom config later
Follow the prompts until you get to a screen that says:

NOTES

Here type :q to exit nvim
Once back at the command prompt, type:

sed -i.bak 's/"clangd"/"clangd", "gopls"/g' ~/.config/nvim/lua/custom/configs/lspconfig.lua

-- that's it. Edit a Go file and you should have full LSP support using gopls!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment