Refine keymap descriptions for clarity and consistency

Updated keymap descriptions across various plugins to include
specific prefixes for better identification and organization.
This commit is contained in:
Ray Elliott 2025-12-12 01:00:25 +00:00
commit f4f6260b20
9 changed files with 83 additions and 66 deletions

View file

@ -14,16 +14,16 @@ local map = vim.keymap.set
map('n', 'gd', function()
-- Built-in: jump to definition via tags or included files
vim.cmd("normal! gd")
end, { desc = 'Go to definition (built-in fallback)', silent = true })
end, { desc = 'Vim: Go to definition (built-in fallback)', silent = true })
map('n', 'gD', function()
-- Built-in: jump to declaration (global)
vim.cmd("normal! gD")
end, { desc = 'Go to declaration (built-in fallback)', silent = true })
end, { desc = 'Vim: Go to declaration (built-in fallback)', silent = true })
-- LSP-only keymaps (no useful fallback for these in non-LSP contexts)
map('n', 'gr', '<Nop>', { desc = 'References (requires LSP)', silent = true })
map('n', 'gI', '<Nop>', { desc = 'Implementation (requires LSP)', silent = true })
map('n', 'gr', '<Nop>', { desc = 'LSP: References (requires LSP)', silent = true })
map('n', 'gI', '<Nop>', { desc = 'LSP: Implementation (requires LSP)', silent = true })
-- K: Hover/Help with sensible fallback
map('n', 'K', function()
@ -32,20 +32,20 @@ map('n', 'K', function()
if vim.bo.keywordprg ~= '' then
vim.cmd("normal! K")
end
end, { desc = 'Hover/Help (LSP or keywordprg fallback)', silent = true })
end, { desc = 'Vim: Hover/Help (keywordprg fallback)', silent = true })
-- Diagnostic keymaps
map('n', '<leader>xx', vim.diagnostic.setloclist, { desc = 'Show buffer diagnostics in location list', silent = true })
map('n', '<leader>xX', vim.diagnostic.setqflist, { desc = 'Show all diagnostics in quickfix', silent = true })
map('n', '<leader>xx', vim.diagnostic.setloclist, { desc = 'Diagnostics: Buffer diagnostics (location list)', silent = true })
map('n', '<leader>xX', vim.diagnostic.setqflist, { desc = 'Diagnostics: All diagnostics (quickfix)', silent = true })
map('n', '<leader>xe', function()
vim.diagnostic.setloclist({ severity = vim.diagnostic.severity.ERROR })
end, { desc = 'Show buffer errors in location list', silent = true })
end, { desc = 'Diagnostics: Buffer errors (location list)', silent = true })
map('n', '<leader>xE', function()
vim.diagnostic.setqflist({ severity = vim.diagnostic.severity.ERROR })
end, { desc = 'Show all errors in quickfix', silent = true })
map('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic', silent = true })
map('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic', silent = true })
map('n', '<leader>xd', vim.diagnostic.open_float, { desc = 'Show diagnostic under cursor', silent = true })
end, { desc = 'Diagnostics: All errors (quickfix)', silent = true })
map('n', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostics: Previous diagnostic', silent = true })
map('n', ']d', vim.diagnostic.goto_next, { desc = 'Diagnostics: Next diagnostic', silent = true })
map('n', '<leader>xd', vim.diagnostic.open_float, { desc = 'Diagnostics: Show diagnostic under cursor', silent = true })
-- Debug: Show highlight group and color under cursor
map('n', '<leader>hi', function()
@ -180,4 +180,4 @@ map('n', '<leader>hi', function()
}
vim.api.nvim_open_win(buf, false, opts)
end, { desc = 'Show highlight group and color under cursor', silent = true })
end, { desc = 'Debug: Show highlight group and color under cursor', silent = true })