nvim: after/ftplugin/go: Add go LSP support

This commit is contained in:
Sanchayan Maity 2022-12-11 16:40:42 +05:30
parent 1766986d8e
commit 9f415d9d4d

View file

@ -0,0 +1,9 @@
local path = vim.fs.find({ 'go.mod', 'go.work', '.git' }, { type = "file" })
local root = vim.fs.dirname(path[1])
vim.lsp.start({
name = "gopls",
cmd = { "gopls" },
root_dir = root,
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
})