nvim: after/ftplugin/go: Add go LSP support
This commit is contained in:
parent
1766986d8e
commit
9f415d9d4d
1 changed files with 9 additions and 0 deletions
9
nvim/.config/nvim/after/ftplugin/go.lua
Normal file
9
nvim/.config/nvim/after/ftplugin/go.lua
Normal 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' },
|
||||||
|
})
|
Loading…
Reference in a new issue