From bbc6a91e8f4d7a2565ce4045b33f595cc7f98b30 Mon Sep 17 00:00:00 2001 From: spinach <19keegandeppe@gmail.com> Date: Wed, 5 Apr 2023 14:56:25 -0400 Subject: [PATCH] added more keybinds and some lsp config --- config/init.lua | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) 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)