From d987981adb154c3fb460a2e0f622267ea32ab83e Mon Sep 17 00:00:00 2001
From: SinTan1729 <sayantan.santra689@gmail.com>
Date: Thu, 27 Mar 2025 01:39:44 -0500
Subject: [PATCH] new: Added new LSP related keymaps

---
 laptop/plugin/lsp_config.lua | 8 +++++++-
 server/plugin/lsp_config.lua | 9 ++++++++-
 vps/plugin/lsp_config.lua    | 9 ++++++++-
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/laptop/plugin/lsp_config.lua b/laptop/plugin/lsp_config.lua
index c568e0b..9fed154 100644
--- a/laptop/plugin/lsp_config.lua
+++ b/laptop/plugin/lsp_config.lua
@@ -22,12 +22,18 @@ lspconfig.ocamllsp.setup {}
 
 lspconfig.hls.setup {}
 
--- Set ;k to hover and ;a to show code actions
+-- ;k to hover
+-- ;a to show code actions
+-- ;d to show diagnostic message
+-- ;n to go to next diagnostic message
+-- ;N to go to previous diagnostic message
 vim.api.nvim_create_autocmd("LspAttach", {
     callback = function()
         map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
         map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
         map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
+        map('n', '<localleader>n', vim.diagnostic.goto_next, { remap = false })
+        map('n', '<localleader>N', vim.diagnostic.goto_prev, { remap = false })
     end,
 })
 
diff --git a/server/plugin/lsp_config.lua b/server/plugin/lsp_config.lua
index 2174e92..d59c484 100644
--- a/server/plugin/lsp_config.lua
+++ b/server/plugin/lsp_config.lua
@@ -12,10 +12,17 @@ local lspconfig = require('lspconfig')
 --   },
 -- }
 
--- Set ;k to hover and ;a to show code actions
+-- ;k to hover
+-- ;a to show code actions
+-- ;d to show diagnostic message
+-- ;n to go to next diagnostic message
+-- ;N to go to previous diagnostic message
 vim.api.nvim_create_autocmd("LspAttach", {
     callback = function()
         map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
         map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
+        map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
+        map('n', '<localleader>n', vim.diagnostic.goto_next, { remap = false })
+        map('n', '<localleader>N', vim.diagnostic.goto_prev, { remap = false })
     end,
 })
diff --git a/vps/plugin/lsp_config.lua b/vps/plugin/lsp_config.lua
index 2174e92..d59c484 100644
--- a/vps/plugin/lsp_config.lua
+++ b/vps/plugin/lsp_config.lua
@@ -12,10 +12,17 @@ local lspconfig = require('lspconfig')
 --   },
 -- }
 
--- Set ;k to hover and ;a to show code actions
+-- ;k to hover
+-- ;a to show code actions
+-- ;d to show diagnostic message
+-- ;n to go to next diagnostic message
+-- ;N to go to previous diagnostic message
 vim.api.nvim_create_autocmd("LspAttach", {
     callback = function()
         map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
         map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
+        map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
+        map('n', '<localleader>n', vim.diagnostic.goto_next, { remap = false })
+        map('n', '<localleader>N', vim.diagnostic.goto_prev, { remap = false })
     end,
 })