I’ve been using LunarVim successfully for years now and I just discover you can set specific LSP settings per project!

I’ve been developing with go and one thing that happens frequently is using build tags. Once a build tag is added, gopls and other tooling will ignore the file where is specified, unless told not to do so.

To edit local configuration you have to run :LSPSettings local gopls

This will open a file in a local .nlsp-settings/ folder where you can add you configuration. In my case, adding the integration build tag:

{
  "gopls": {
    "build.buildFlags": [
      "-tags=integration"
    ],
  }
}

Bonus trick 

If you add this snippet

{
  "gopls": {
    "ui.diagnostic.analyses": {
      "fieldalignment": true,
      "nilness": true,
      "unusedparams": true,
      "unusedwrite": true
    }
  }
}

to your global gopls LSP settings (open it with :LSPSettings gopls) you get autocompletion for settings like in other editors. 🌟