From fa0957ddc6796c08fa82a81d84a10702212a4b4b Mon Sep 17 00:00:00 2001 From: Jidbo Date: Wed, 5 Oct 2022 18:50:22 +0200 Subject: [PATCH] update lsp keymappings --- nvim/lua/autocompletion.lua | 18 +++++++++--------- nvim/lua/troubleconfig.lua | 5 +---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/nvim/lua/autocompletion.lua b/nvim/lua/autocompletion.lua index eda2ded..0ac6495 100644 --- a/nvim/lua/autocompletion.lua +++ b/nvim/lua/autocompletion.lua @@ -51,15 +51,15 @@ local on_attach = function(client, bufnr) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local opts = { noremap = true, silent = true } - buf_set_keymap("n", "gd", "Telescope lsp_definitions", opts) - buf_set_keymap("n", "gD", "Telescope lsp_implementations", opts) - vim.keymap.set("n", "gf", vim.lsp.buf.format) - vim.keymap.set("n", "gh", vim.lsp.buf.hover) - vim.keymap.set("n", "ge", vim.diagnostic.open_float) - vim.keymap.set("n", "gs", vim.lsp.buf.signature_help) - vim.keymap.set("n", "gR", vim.lsp.buf.rename) - vim.keymap.set("n", "gH", vim.lsp.buf.code_action) + local opts = { noremap = true, silent = true, buffer=0 } + vim.keymap.set("n", "gd", "Telescope lsp_definitions", opts) + vim.keymap.set("n", "gD", "Telescope lsp_implementations", opts) + vim.keymap.set("n", "gf", function() vim.lsp.buf.format {async = true} end, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "ge", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "gs", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "gR", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "gH", vim.lsp.buf.code_action, opts) end -- LSP INSTALLER diff --git a/nvim/lua/troubleconfig.lua b/nvim/lua/troubleconfig.lua index 9d291b8..2deb385 100644 --- a/nvim/lua/troubleconfig.lua +++ b/nvim/lua/troubleconfig.lua @@ -1,7 +1,4 @@ -require("trouble").setup { - - -} +require("trouble").setup {} vim.keymap.set("n", "xx", "TroubleToggle", {silent = true, noremap = true}