remove obsolete mappings, add mappings for staging and unstaging of seletcd hunks

This commit is contained in:
xesc 2025-03-02 16:46:34 +01:00
parent 46e71b2461
commit 36aa117fbf

View file

@ -15,23 +15,12 @@ return {
opts.buffer = bufnr opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts) vim.keymap.set(mode, l, r, opts)
end end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, { expr = true })
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, { expr = true })
-- Actions
map('n', '<leader>gB', function() gs.blame_line { full = true } end) map('n', '<leader>gB', function() gs.blame_line { full = true } end)
map('n', '<leader>gb', gs.toggle_current_line_blame) map('n', '<leader>gb', gs.toggle_current_line_blame)
map('n', '<leader>gs', gs.stage_hunk) -- git stage this
map('v', '<leader>gs', gs.stage_hunk) -- git stage this
map('n', '<leader>gus', gs.undo_stage_hunk) -- git undo stage this
map('v', '<leader>gus', gs.undo_stage_hunk) -- git undo stage this
end end
}) })
end, end,