From 0a932e8f8047864d5b901cd1ccf889b67ae3e73f Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 1 Mar 2022 22:04:00 +0000 Subject: Go LSP support --- lsp.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lsp.lua b/lsp.lua index 7854edb..d98d914 100644 --- a/lsp.lua +++ b/lsp.lua @@ -46,6 +46,14 @@ local servers = { } } }, + gopls = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + }, + }, } for lsp, settings in pairs(servers) do require('lspconfig')[lsp].setup { @@ -57,3 +65,7 @@ for lsp, settings in pairs(servers) do settings = settings, } end + +-- for go +-- install gopls with: go install golang.org/x/tools/gopls@latest +vim.cmd([[autocmd BufWritePre *.go :lua vim.lsp.buf.formatting_seq_sync()]]) -- cgit v1.2.3