From da8c22075b7bebb3d43f26073bb44fd30ee220fc Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Wed, 26 Feb 2025 10:51:31 +0100 Subject: [PATCH] Improve keybindings --- nvim/lua/plugins/lspconfig.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index 1dc7a25..87c8d2b 100755 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -28,7 +28,7 @@ return { keymap.set("n", "gR", "Telescope lsp_references", opts) opts.desc = "Go to declaration" - keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + keymap.set("n", "gD", ":lua vim.lsp.buf.declaration", opts) opts.desc = "Show LSP definitions" keymap.set("n", "gd", "Telescope lsp_definitions", opts) @@ -52,7 +52,7 @@ return { keymap.set("n", "ga", "Telescope diagnostics bufnr=0", opts) opts.desc = "Show line diagnostics" - keymap.set("n", "gA", vim.diagnostic.open_float, opts) + keymap.set("n", "gA", ":lua vim.diagnostic.open_float()", opts) opts.desc = "Go to previous diagnostic" keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) @@ -133,6 +133,8 @@ return { }) local java_on_attach = function(client, bufnr) + on_attach(client, bufnr) + opts.buffer = bufnr -- Keybinds for testing, refactoring, java specific opts.desc = "Java profiling"