aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-03-01 22:04:00 +0000
committerJuan J. Martinez <jjm@usebox.net>2022-05-29 22:57:31 +0100
commit0a932e8f8047864d5b901cd1ccf889b67ae3e73f (patch)
treec6c9fef3b9a46e3fc8fffa119c518124e5c5f4be
parentd450bee630a28c5f2c1ca4c6e429fa93958cdc8e (diff)
downloaddotnvim-0a932e8f8047864d5b901cd1ccf889b67ae3e73f.tar.gz
dotnvim-0a932e8f8047864d5b901cd1ccf889b67ae3e73f.zip
Go LSP support
-rw-r--r--lsp.lua12
1 files changed, 12 insertions, 0 deletions
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()]])