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
1 changed files with 9 additions and 0 deletions

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' },
})