-- The built-in `git` filetype is reused for our `:G show` / `:G cat-file -p` -- output buffers and for commits opened from the log window. We set -- `vim.b.git_worktree` before assigning the filetype on those buffers; the -- guard below keeps the dispatcher off any unrelated git buffer (a -- real `.git/HEAD` file, etc.) so the default normal-mode still works. if not vim.b.git_worktree then return end local cr = vim.api.nvim_replace_termcodes("", true, false, true) vim.keymap.set("n", "", function() if not require("git.show").open_at_cursor() then -- "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 file at commit" })