From c607278c2a9370acc8091ce0445641295d5ecb2c Mon Sep 17 00:00:00 2001 From: pml68 Date: Tue, 16 Jul 2024 17:20:08 +0200 Subject: feat: add rounded border to lsp hover, set leader gh to diagnostic.goto_next --- lua/pml68/configs/lspconfig.lua | 4 ++++ lua/pml68/remap.lua | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/pml68/configs/lspconfig.lua b/lua/pml68/configs/lspconfig.lua index 4951475..5f79687 100644 --- a/lua/pml68/configs/lspconfig.lua +++ b/lua/pml68/configs/lspconfig.lua @@ -1,6 +1,10 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require("lspconfig") +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { + border = "rounded", +}) + local servers = { "asm_lsp", "html", diff --git a/lua/pml68/remap.lua b/lua/pml68/remap.lua index be64b0c..c11bf29 100644 --- a/lua/pml68/remap.lua +++ b/lua/pml68/remap.lua @@ -61,7 +61,7 @@ vim.api.nvim_create_autocmd('LspAttach', { callback = function(event) local opts = { buffer = event.buf } - vim.keymap.set('n', 'gh', 'lua vim.lsp.buf.hover()', opts) + vim.keymap.set('n', 'gh', 'lua vim.diagnostic.goto_next({ float = { border = "rounded" } })', opts) vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()', opts) vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) -- cgit v1.2.3