diff --git a/nvim/.config/nvim/after/ftplugin/go.lua b/nvim/.config/nvim/after/ftplugin/go.lua new file mode 100644 index 0000000..4625ea2 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/go.lua @@ -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' }, +})