map gitsign next/prev to <l>h{np}, preview as <l>hv

This commit is contained in:
leafee98 2023-12-15 12:53:14 +08:00
parent 7c7e823b54
commit fdab14f6dc

View file

@ -12,13 +12,13 @@ return {
vim.keymap.set(mode, l, r, opts) vim.keymap.set(mode, l, r, opts)
end end
m("n", "<leader>hj", function() m("n", "<leader>hn", function()
if vim.wo.diff then return "]c" end if vim.wo.diff then return "]c" end
vim.schedule(function() gs.next_hunk() end) vim.schedule(function() gs.next_hunk() end)
return "<Ignore>" return "<Ignore>"
end, {expr=true}) end, {expr=true})
m("n", "<leader>hk", function() m("n", "<leader>hp", function()
if vim.wo.diff then return "[c" end if vim.wo.diff then return "[c" end
vim.schedule(function() gs.prev_hunk() end) vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>" return "<Ignore>"
@ -31,7 +31,7 @@ return {
m("n", "<leader>hS", gs.stage_buffer) m("n", "<leader>hS", gs.stage_buffer)
m("n", "<leader>hu", gs.undo_stage_hunk) m("n", "<leader>hu", gs.undo_stage_hunk)
m("n", "<leader>hR", gs.reset_buffer) m("n", "<leader>hR", gs.reset_buffer)
m("n", "<leader>hp", gs.preview_hunk) m("n", "<leader>hv", gs.preview_hunk)
m("n", "<leader>hb", function() gs.blame_line{full=true} end) m("n", "<leader>hb", function() gs.blame_line{full=true} end)
m("n", "<leader>htb", gs.toggle_current_line_blame) m("n", "<leader>htb", gs.toggle_current_line_blame)
m("n", "<leader>hd", gs.diffthis) m("n", "<leader>hd", gs.diffthis)