feat(git): replace vim-fugitive with custom git module
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
local cr = vim.api.nvim_replace_termcodes("<CR>", true, false, true)
|
||||
|
||||
vim.keymap.set("n", "<CR>", function()
|
||||
local worktree = vim.b.git_worktree
|
||||
local sha = worktree
|
||||
and vim.api.nvim_get_current_line():match("(%x%x%x%x%x%x%x+)")
|
||||
if sha then
|
||||
require("git.show").open_commit(worktree, sha)
|
||||
else
|
||||
-- "n" mode = no remap, so this doesn't recurse into our mapping.
|
||||
vim.api.nvim_feedkeys(cr, "n", false)
|
||||
end
|
||||
end, { buffer = 0, silent = true, desc = "Open commit" })
|
||||
Reference in New Issue
Block a user