diff --git a/nvim/lua/jj-snacks.lua b/nvim/lua/jj-snacks.lua index f89e7d6..dbe7807 100644 --- a/nvim/lua/jj-snacks.lua +++ b/nvim/lua/jj-snacks.lua @@ -192,7 +192,7 @@ Snacks.picker.jj_show = function(ref) item.cwd = cwd item.status = status item.file = file - local base, prev, next, suffix = file:match("^(.*){(.+) => (.+)}(.*)$") + local base, prev, next, suffix = file:match("^(.*){(.*) => (.*)}(.*)$") if base ~= nil then item.rename = base .. prev .. suffix item.file = base .. next .. suffix @@ -263,11 +263,13 @@ Snacks.picker.jj_show = function(ref) end, jj_gsplit = function(picker, item) picker:close() - vim.cmd('Gvsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. item.file)) + local commit = vim.trim(vim.fn.system({ "jj", "show", ref, "--template", "commit_id", "--no-patch" })) + vim.cmd('Gvsplit ' .. vim.fn.fnameescape(commit .. ':' .. item.file)) end, jj_gvsplit = function(picker, item) picker:close() - vim.cmd('Gsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. item.file)) + local commit = vim.trim(vim.fn.system({ "jj", "show", ref, "--template", "commit_id", "--no-patch" })) + vim.cmd('Gsplit ' .. vim.fn.fnameescape(commit .. ':' .. item.file)) end, }, }) diff --git a/nvim/lua/plugins/motions.lua b/nvim/lua/plugins/motions.lua index cc1ed63..ecce33e 100644 --- a/nvim/lua/plugins/motions.lua +++ b/nvim/lua/plugins/motions.lua @@ -1,5 +1,7 @@ -vim.keymap.set({ 'n', 'x', 'o' }, 's', '(leap)') -vim.keymap.set('n', 'S', '(leap-from-window)') +vim.keymap.set({ "n", "x" }, "s", "(leap-forward-till)", { desc = "Leap forward to" }) +vim.keymap.set({ "n", "x" }, "S", "(leap-backward)", { desc = "Leap backward to" }) +vim.keymap.set("o", "z", "(leap-forward-till)", { desc = "Leap forward to" }) +vim.keymap.set("o", "Z", "(leap-backward)", { desc = "Leap backward to" }) local function ft(key_specific_args) require('leap').leap(