From e086949aafbfb5fa154b5ab0c7d1898fb0d28c90 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Sat, 8 Oct 2022 17:16:05 +0200 Subject: [PATCH] [neovim] Update keymaps --- .config/nvim/lua/user/keymaps.lua | 5 ++++- .config/nvim/lua/user/lsp/handlers.lua | 15 +++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.config/nvim/lua/user/keymaps.lua b/.config/nvim/lua/user/keymaps.lua index 497ccec..5cced00 100644 --- a/.config/nvim/lua/user/keymaps.lua +++ b/.config/nvim/lua/user/keymaps.lua @@ -44,7 +44,10 @@ keymap("n", "xw", "TroubleToggle workspace_diagnostics", opts) keymap("n", "xd", "TroubleToggle document_diagnostics", opts) keymap("n", "xl", "TroubleToggle loclist", opts) keymap("n", "xq", "TroubleToggle quickfix", opts) -keymap("n", "gR", "TroubleToggle lsp_references", opts) +keymap("n", "gd", "TroubleToggle lsp_definitions", opts) +keymap("n", "gt", "TroubleToggle lsp_type_definitions", opts) +keymap("n", "gi", "TroubleToggle lsp_implementations", opts) +keymap("n", "gr", "TroubleToggle lsp_references", opts) -- Better paste keymap("v", "p", '"_dP', opts) diff --git a/.config/nvim/lua/user/lsp/handlers.lua b/.config/nvim/lua/user/lsp/handlers.lua index e88b348..11489be 100644 --- a/.config/nvim/lua/user/lsp/handlers.lua +++ b/.config/nvim/lua/user/lsp/handlers.lua @@ -54,21 +54,20 @@ end local function lsp_keymaps(bufnr) local opts = { noremap = true, silent = true } local keymap = vim.api.nvim_buf_set_keymap - keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) - keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) + keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) - keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) - keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) - keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) + keymap(bufnr, "n", "D", "lua vim.diagnostic.open_float()", opts) keymap(bufnr, "n", "lf", "lua vim.lsp.buf.format{ async=true }", opts) - -- keymap(bufnr, "n", "li", "LspInfo", opts) - -- keymap(bufnr, "n", "lI", "LspInstallInfo", opts) keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) keymap(bufnr, "n", "lj", "lua vim.diagnostic.goto_next({buffer=0})", opts) keymap(bufnr, "n", "lk", "lua vim.diagnostic.goto_prev({buffer=0})", opts) keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) keymap(bufnr, "n", "ls", "lua vim.lsp.buf.signature_help()", opts) - keymap(bufnr, "n", "lq", "lua vim.diagnostic.setloclist()", opts) + -- keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) + -- keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) + -- keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) + -- keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) + -- keymap(bufnr, "n", "lq", "lua vim.diagnostic.setloclist()", opts) end M.on_attach = function(client, bufnr)