add go support
This commit is contained in:
22
nvim/.config/nvim/lsp/gopls.lua
Normal file
22
nvim/.config/nvim/lsp/gopls.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
cmd = { "gopls" },
|
||||
root_markers = { "go.mod" },
|
||||
filetypes = { "go", "golang" },
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
["ui.inlayhint.hints"] = {
|
||||
compositeLiteralFields = true,
|
||||
constantValues = true,
|
||||
parameterNames = true,
|
||||
assignVariableTypes = true,
|
||||
functionTypeParameters = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
vim.lsp.enable("luals")
|
||||
vim.lsp.enable("rust")
|
||||
vim.lsp.enable("gopls")
|
||||
vim.lsp.enable("bashls")
|
||||
vim.lsp.enable("terraform")
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ return {
|
||||
sh = { "shfmt" },
|
||||
-- brew install ruff
|
||||
python = { "ruff" },
|
||||
-- go install mvdan.cc/gofumpt@latest
|
||||
go = { "gofumpt" },
|
||||
},
|
||||
formatters = {
|
||||
prettier = {
|
||||
|
||||
@@ -11,6 +11,8 @@ return {
|
||||
sh = { "shellcheck" },
|
||||
-- brew install tflint
|
||||
terraform = { "tflint" },
|
||||
-- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0
|
||||
go = { "golangcilint" },
|
||||
}
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user