update keymap descriptions for a little bit more consistency

This commit is contained in:
Gered 2024-09-07 15:49:37 -04:00
parent b15a616ef0
commit 920776c81d
12 changed files with 52 additions and 52 deletions

View file

@ -42,13 +42,13 @@ return {
map('n', '<A-0>', '<Cmd>BufferLast<CR>', 'Goto Last Buffer') map('n', '<A-0>', '<Cmd>BufferLast<CR>', 'Goto Last Buffer')
map('n', '<A-p>', '<Cmd>BufferPin<CR>', 'Pin/Unpin Buffer') map('n', '<A-p>', '<Cmd>BufferPin<CR>', 'Pin/Unpin Buffer')
map('n', '<leader>bp', '<Cmd>BufferPin<CR>', 'Toggle [P]in') map('n', '<leader>bp', '<Cmd>BufferPin<CR>', 'Buffer: Toggle [P]in')
map('n', '<A-c>', '<Cmd>BufferClose<CR>', 'Close Current Buffer') map('n', '<A-c>', '<Cmd>BufferClose<CR>', 'Close Current Buffer')
map('n', '<leader>bd', '<Cmd>BufferClose<CR>', 'Close Current Buffer') map('n', '<leader>bd', '<Cmd>BufferClose<CR>', 'Buffer: Close Current Buffer')
map('n', '<leader>bc', '<Cmd>BufferCloseAllButCurrentOrPined<CR>', 'Close Other Buffers') map('n', '<leader>bc', '<Cmd>BufferCloseAllButCurrentOrPined<CR>', 'Buffer: Close Other Buffers')
map('n', '<leader>ba', '<Cmd>BufferCloseAllBunPinned<CR>', 'Close All Buffers') map('n', '<leader>ba', '<Cmd>BufferCloseAllBunPinned<CR>', 'Buffer: Close All Buffers')
end, end,
}, },
} }

View file

@ -39,25 +39,25 @@ return {
-- visual mode -- visual mode
map('v', '<leader>hs', function() map('v', '<leader>hs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'stage git hunk' }) end, { desc = 'Git: [s]tage git hunk' })
map('v', '<leader>hr', function() map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'reset git hunk' }) end, { desc = 'Git: [r]eset git hunk' })
-- normal mode -- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'Git: [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'Git: [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'Git: [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'Git: [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'Git: [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'Git: [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', '<leader>hb', gitsigns.blame_line, { desc = 'Git: [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', '<leader>hd', gitsigns.diffthis, { desc = 'Git: [d]iff against index' })
map('n', '<leader>hD', function() map('n', '<leader>hD', function()
gitsigns.diffthis '@' gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' }) end, { desc = 'Git: [D]iff against last commit' })
-- Toggles -- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = 'Toggle: Git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = 'Toggle: Git show [D]eleted' })
end, end,
}, },
}, },

View file

@ -8,7 +8,7 @@ return {
vim.keymap.set('n', '<leader>ti', function() vim.keymap.set('n', '<leader>ti', function()
local enabled = require('ibl.config').get_config(0).enabled local enabled = require('ibl.config').get_config(0).enabled
require('ibl').setup_buffer(0, { enabled = not enabled }) require('ibl').setup_buffer(0, { enabled = not enabled })
end, { desc = '[T]oggle [I]ndentation Guides' }) end, { desc = 'Toggle: [i]ndentation Guides' })
return { return {
enabled = false, enabled = false,

View file

@ -38,45 +38,45 @@ return {
callback = function(event) callback = function(event)
local map = function(keys, func, desc, mode) local map = function(keys, func, desc, mode)
mode = mode or 'n' mode = mode or 'n'
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = desc })
end end
-- Jump to the definition of the word under your cursor. -- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc. -- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-t>. -- To jump back, press <C-t>.
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') map('gd', require('telescope.builtin').lsp_definitions, 'LSP: [G]oto [D]efinition')
-- WARN: This is not Goto Definition, this is Goto Declaration. -- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header. -- For example, in C this would take you to the header.
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
-- Find references for the word under your cursor. -- Find references for the word under your cursor.
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') map('gr', require('telescope.builtin').lsp_references, 'LSP: [G]oto [R]eferences')
-- Jump to the implementation of the word under your cursor. -- Jump to the implementation of the word under your cursor.
-- Useful when your language has ways of declaring types without an actual implementation. -- Useful when your language has ways of declaring types without an actual implementation.
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') map('gI', require('telescope.builtin').lsp_implementations, 'LSP: [G]oto [I]mplementation')
-- Jump to the type of the word under your cursor. -- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see -- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*. -- the definition of its *type*, not where it was *defined*.
map('<leader>lt', require('telescope.builtin').lsp_type_definitions, '[T]ype Definition') map('<leader>lt', require('telescope.builtin').lsp_type_definitions, 'LSP: [T]ype Definition')
-- Fuzzy find all the symbols in your current document. -- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc. -- Symbols are things like variables, functions, types, etc.
map('<leader>ld', require('telescope.builtin').lsp_document_symbols, '[D]ocument Symbols') map('<leader>ld', require('telescope.builtin').lsp_document_symbols, 'LSP: [D]ocument Symbols')
-- Fuzzy find all the symbols in your current workspace. -- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project. -- Similar to document symbols, except searches over your entire project.
map('<leader>lw', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace Symbols') map('<leader>lw', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'LSP: [W]orkspace Symbols')
-- Rename the variable under your cursor. -- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc. -- Most Language Servers support renaming across files, etc.
map('<leader>lr', vim.lsp.buf.rename, '[R]ename') map('<leader>lr', vim.lsp.buf.rename, 'LSP: [R]ename')
-- Execute a code action, usually your cursor needs to be on top of an error -- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate. -- or a suggestion from your LSP for this to activate.
map('<leader>la', vim.lsp.buf.code_action, 'Code [A]ction', { 'n', 'x' }) map('<leader>la', vim.lsp.buf.code_action, 'LSP: Code [A]ction', { 'n', 'x' })
-- The following two autocommands are used to highlight references of the -- The following two autocommands are used to highlight references of the
-- word under your cursor when your cursor rests there for a little while. -- word under your cursor when your cursor rests there for a little while.
@ -110,7 +110,7 @@ return {
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
map('<leader>th', function() map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints') end, 'Toggle: Inlay [H]ints')
end end
end, end,
}) })

View file

@ -5,7 +5,7 @@ return {
-- no need to call this plugin's setup() apparently unless you want automatic buffer -- no need to call this plugin's setup() apparently unless you want automatic buffer
-- attaching based on filetype. and to customize the default options. -- attaching based on filetype. and to customize the default options.
vim.keymap.set('n', '<leader>tc', '<Cmd>ColorizerToggle<CR>', { desc = '[T]oggle [C]olor Previewing' }) vim.keymap.set('n', '<leader>tc', '<Cmd>ColorizerToggle<CR>', { desc = 'Toggle: [C]olor Previewing' })
end, end,
}, },
} }

View file

@ -35,21 +35,21 @@ return {
{ '<F6>', dapui.toggle, desc = 'Debug: Toggle Debug UI' }, { '<F6>', dapui.toggle, desc = 'Debug: Toggle Debug UI' },
-- Breakpoints -- Breakpoints
{ '<leader>db', dap.toggle_breakpoint, desc = 'Toggle [B]reakpoint' }, { '<leader>db', dap.toggle_breakpoint, desc = 'Debug: Toggle [B]reakpoint' },
{ {
'<leader>dB', '<leader>dB',
function() function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end, end,
desc = 'Set [B]reakpoint', desc = 'Debug: Set [B]reakpoint',
}, },
{ '<leader>dc', dap.clear_breakpoints, desc = '[C]lear All Breakpoints' }, { '<leader>dc', dap.clear_breakpoints, desc = 'Debug: [C]lear All Breakpoints' },
{ {
'<leader>dl', '<leader>dl',
function() function()
dap.list_breakpoints(true) dap.list_breakpoints(true)
end, end,
desc = '[L]ist Breakpoints', desc = 'Debug: [L]ist Breakpoints',
}, },
unpack(keys), unpack(keys),

View file

@ -6,7 +6,7 @@ return {
function() function()
vim.cmd 'Telescope notify' vim.cmd 'Telescope notify'
end, end,
desc = '[S]earch Notification Histor[y]', desc = 'Search: Notification Histor[y]',
}, },
}, },
opts = { opts = {

View file

@ -11,7 +11,7 @@ return {
}, },
} }
vim.keymap.set('n', '<leader>to', '<Cmd>Outline<CR>', { desc = 'Toggle [O]utline' }) vim.keymap.set('n', '<leader>to', '<Cmd>Outline<CR>', { desc = 'Toggle: [O]utline' })
vim.keymap.set('n', '<F2>', '<Cmd>Outline<CR>', { desc = 'Toggle Outline', noremap = true }) vim.keymap.set('n', '<F2>', '<Cmd>Outline<CR>', { desc = 'Toggle Outline', noremap = true })
end, end,
}, },

View file

@ -69,16 +69,16 @@ return {
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
local builtin = require 'telescope.builtin' local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = 'Search: [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = 'Search: [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = 'Search: [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = 'Search: [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = 'Search: Current [W]ord' })
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = 'Search: By [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = 'Search: [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = 'Search: [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = 'Search: Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = 'Find existing buffers' })
-- Slightly advanced example of overriding default behavior and theme -- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function() vim.keymap.set('n', '<leader>/', function()
@ -96,12 +96,12 @@ return {
grep_open_files = true, grep_open_files = true,
prompt_title = 'Live Grep in Open Files', prompt_title = 'Live Grep in Open Files',
} }
end, { desc = '[S]earch [/] in Open Files' }) end, { desc = 'Search: [/] In Open Files' })
-- Shortcut for searching your Neovim configuration files -- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>sn', function() vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' } builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' }) end, { desc = 'Search: [N]eovim files' })
end, end,
}, },
} }

View file

@ -6,7 +6,7 @@ return {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
}, },
keys = { keys = {
{ '<leader>sc', '<Cmd>TodoTelescope<CR>', desc = '[S]earch Todo [C]omments' }, { '<leader>sc', '<Cmd>TodoTelescope<CR>', desc = 'Search: Todo [C]omments' },
}, },
opts = { opts = {
signs = false, signs = false,

View file

@ -7,7 +7,7 @@ return {
} }
local toggleterm = require 'toggleterm' local toggleterm = require 'toggleterm'
vim.keymap.set('n', '<leader>tt', toggleterm.toggle, { desc = '[T]oggle Terminal' }) vim.keymap.set('n', '<leader>tt', toggleterm.toggle, { desc = 'Toggle: Terminal' })
vim.api.nvim_create_autocmd('TermOpen', { vim.api.nvim_create_autocmd('TermOpen', {
desc = 'Set toggleterm keymaps on terminal open', desc = 'Set toggleterm keymaps on terminal open',

View file

@ -3,10 +3,10 @@ return {
'folke/trouble.nvim', 'folke/trouble.nvim',
cmd = 'Trouble', cmd = 'Trouble',
keys = { keys = {
{ '<leader>tg', '<Cmd>Trouble diagnostics toggle pinned=true filter.buf=0<CR>', desc = 'Toggle Dia[g]nostics for Buffer' }, { '<leader>tg', '<Cmd>Trouble diagnostics toggle pinned=true filter.buf=0<CR>', desc = 'Toggle: Dia[g]nostics for Buffer' },
{ '<F3>', '<Cmd>Trouble diagnostics toggle pinned=true filter.buf=0<CR>', desc = 'Toggle Diagnostics for Buffer' }, { '<F3>', '<Cmd>Trouble diagnostics toggle pinned=true filter.buf=0<CR>', desc = 'Toggle Diagnostics for Buffer' },
{ '<leader>tG', '<Cmd>Trouble diagnostics toggle<CR>', desc = 'Toggle Dia[g]nostics' }, { '<leader>tG', '<Cmd>Trouble diagnostics toggle<CR>', desc = 'Toggle: Dia[g]nostics' },
{ '<leader>tq', '<Cmd>Trouble qflist toggle<CR>', desc = 'Toggle [Q]uickfixes' }, { '<leader>tq', '<Cmd>Trouble qflist toggle<CR>', desc = 'Toggle: [Q]uickfixes' },
}, },
opts = { opts = {
focus = true, focus = true,