diff --git a/config/init.lua b/config/init.lua index 3ea87da..44dd5d4 100644 --- a/config/init.lua +++ b/config/init.lua @@ -48,21 +48,46 @@ vim.cmd([[ -- language server setup local lspconfig = require('lspconfig') -lspconfig.gopls.setup{} +-- Go +lspconfig.gopls.setup{ + cmd = {"gopls", "server"}, + filetypes = {"go", "gomod"}, + settings = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + }, + }, +} + +-- C/C++ lspconfig.clangd.setup{} + +-- Lua lspconfig.lua_ls.setup{ settings = { Lua = { - diagnostics = { globals = { 'vim' } }, + diagnostics = {globals = {'vim'}}, }, telemetry = { enable = false, }, }, } + +-- Rust lspconfig.rust_analyzer.setup{} + +-- Python lspconfig.pylsp.setup{} +-- TypeScript +lspconfig.tsserver.setup{} + -- lsp mappingsd vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) +vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) +vim.keymap.set('n', 'H', vim.lsp.buf.hover, opts)