30 lines
714 B
Lua
30 lines
714 B
Lua
local util = require("util")
|
|
|
|
---@type vim.lsp.Config
|
|
return {
|
|
settings = {
|
|
gopls = {
|
|
staticcheck = true,
|
|
semanticTokens = true,
|
|
analyses = {
|
|
ST1003 = false,
|
|
},
|
|
},
|
|
},
|
|
on_attach = function(client, bufnr)
|
|
vim.keymap.set("n", "<leader>lf", function()
|
|
util.format({
|
|
buf = bufnr,
|
|
cmd = {
|
|
"golines",
|
|
"-m",
|
|
"80",
|
|
"--shorten-comments",
|
|
},
|
|
output = "stdout",
|
|
})
|
|
vim.lsp.buf.format({ async = true })
|
|
end, { buffer = bufnr })
|
|
end,
|
|
}
|