Cleaning up WhichKey hints

This commit is contained in:
Daniel Weber 2024-04-17 22:15:13 -04:00
parent 7d476d886b
commit 4924454d0a
5 changed files with 25 additions and 17 deletions

View File

@ -33,16 +33,16 @@ require('gitsigns').setup{
end)
-- Actions
map('n', '<leader>hs', gitsigns.stage_hunk)
map('n', '<leader>hr', gitsigns.reset_hunk)
map('n', '<leader>hS', gitsigns.stage_buffer)
map('n', '<leader>hu', gitsigns.undo_stage_hunk)
map('n', '<leader>hR', gitsigns.reset_buffer)
map('n', '<leader>hp', gitsigns.preview_hunk)
map('n', '<leader>hb', function() gitsigns.blame_line{full=true} end)
map('n', '<leader>tb', gitsigns.toggle_current_line_blame)
map('n', '<leader>hd', gitsigns.diffthis)
map('n', '<leader>hD', function() gitsigns.diffthis('~') end)
map('n', '<leader>td', gitsigns.toggle_deleted)
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'stage hunk')
map('n', '<leader>hr', gitsigns.reset_hunk, 'reset hunk')
map('n', '<leader>hS', gitsigns.stage_buffer, 'stage buffer')
map('n', '<leader>hu', gitsigns.undo_stage_hunk, 'undo stage hunk')
map('n', '<leader>hR', gitsigns.reset_buffer, 'reset buffer')
map('n', '<leader>hp', gitsigns.preview_hunk, 'preview hunk')
map('n', '<leader>hb', function() gitsigns.blame_line{full=true} end, 'hunk blame')
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, 'toggle single line blame')
map('n', '<leader>hd', gitsigns.diffthis, 'hunk diff')
map('n', '<leader>hD', function() gitsigns.diffthis('~') end, 'diff deleted')
map('n', '<leader>td', gitsigns.toggle_deleted, 'toggle deleted')
end
}

View File

@ -1,5 +1,5 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fs', builtin.grep_string, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Find files" })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "Find in live grep" })
vim.keymap.set('n', '<leader>fs', builtin.grep_string, { desc = "Find string" })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Find from help" })

View File

@ -1 +1 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
vim.keymap.set("n", "<leader>tu", vim.cmd.UndotreeToggle, { desc = 'Toggle undo tree' })

View File

@ -0,0 +1,8 @@
-- Document existing key chains
require('which-key').register {
['<leader>f'] = { name = '[F]ind', _ = 'which_key_ignore' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
}

View File

@ -13,7 +13,7 @@ vim.opt.swapfile = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.hlsearch = true
vim.opt.incsearch = true
vim.opt.termguicolors = true