dotfiles/nvim/.config/nvim/after/ftplugin/go.lua

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
257 B
Lua
Raw Normal View History

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