Skip to content

Instantly share code, notes, and snippets.

@mortymacs
Created May 19, 2023 19:42
Show Gist options
  • Save mortymacs/7a5c2747fe469070aae4e8cb46fbc100 to your computer and use it in GitHub Desktop.
Save mortymacs/7a5c2747fe469070aae4e8cb46fbc100 to your computer and use it in GitHub Desktop.
Attach LSP if current directory has "go.mod" file.
local Path = require("plenary.path")
local lsp = require("lspconfig")
if Path:new("go.mod"):exists() then
print("load go")
lsp.gopls.setup()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment