From 5eb3d923c14913d2cd586ada5359878811049a0f Mon Sep 17 00:00:00 2001 From: Nick Burt Date: Thu, 25 Jan 2024 01:51:39 -0600 Subject: [PATCH] fix labeling and remove unused git hunk shortcuts --- lua/plugins/gitsigns.lua | 27 +++++++++++---------------- lua/plugins/whichkey.lua | 1 - 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 1d4223ee..9865461d 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -43,31 +43,26 @@ return { -- visual mode map('v', 'ghs', function() gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) + end, { desc = '[S]tage [G]it [H]unk' }) map('v', 'ghr', function() gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) + end, { desc = '[R]eset [G]it [H]unk' }) -- normal mode - map('n', 'ghs', gs.stage_hunk, { desc = 'git stage hunk' }) - map('n', 'ghr', gs.reset_hunk, { desc = 'git reset hunk' }) - map('n', 'ghS', gs.stage_buffer, { desc = 'git Stage buffer' }) - map('n', 'ghu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) - map('n', 'ghR', gs.reset_buffer, { desc = 'git Reset buffer' }) - map('n', 'ghp', gs.preview_hunk, { desc = 'preview git hunk' }) + map('n', 'ghs', gs.stage_hunk, { desc = '[G]it [S]tage [H]unk' }) + map('n', 'ghr', gs.reset_hunk, { desc = '[G]it [R]eset [H]unk' }) + map('n', 'ghS', gs.stage_buffer, { desc = '[G]it [S]tage buffer' }) + map('n', 'ghu', gs.undo_stage_hunk, { desc = '[U]ndo stage [H]unk' }) + map('n', 'ghR', gs.reset_buffer, { desc = '[G]it [R]eset buffer' }) + map('n', 'ghp', gs.preview_hunk, { desc = '[P]review [G]it [H]unk' }) map('n', 'ghb', function() gs.blame_line { full = false } - end, { desc = 'git blame line' }) - map('n', 'ghd', gs.diffthis, { desc = 'git diff against index' }) - map('n', 'ghD', function() - gs.diffthis '~' - end, { desc = 'git diff against last commit' }) + end, { desc = '[G]it blame line' }) -- Toggles - map('n', 'tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) - map('n', 'td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) + map('n', 'ghx', gs.toggle_deleted, { desc = 'toggle [G]it show deleted' }) -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select git hunk' }) + map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select [G]it [H]unk' }) end } } diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua index c5dbc061..2e7edbc9 100644 --- a/lua/plugins/whichkey.lua +++ b/lua/plugins/whichkey.lua @@ -8,7 +8,6 @@ return { 'folke/which-key.nvim', opts = {}, ['gh'] = { name = '[G]it [H]unk', _ = 'which_key_ignore' }, ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, } -- register which-key VISUAL mode