-- VSCode-style diff viewer, replaces sindrets/diffview.nvim. -- The C diff library is downloaded automatically on first use (:CodeDiff install to force). return { "esmuellert/codediff.nvim", cmd = "CodeDiff", opts = { diff = { layout = "side-by-side", }, explorer = { -- Match diffview's file panel: tree listing with +/- line stats view_mode = "tree", line_stats = { enabled = true, }, }, keymaps = { view = { -- gq closed every diffview panel, keep it alongside the default q quit = { "q", "gq" }, -- Default b shadows LazyVim's +buffer group, e/E mirrors -- LazyVim's explorer mnemonic instead toggle_explorer = "E", focus_explorer = "e", -- Defaults t and gc shadow the t{char} motion and the gc comment -- operator in the (editable) modified buffer toggle_layout = "gl", toggle_compact = "gz", }, }, }, keys = { { "gv", "CodeDiff", desc = "Open [g]it Diff[v]iew tab" }, { "gl", "CodeDiff history %", desc = "Toggle git log of current file history" }, { "gl", ":'<,'>CodeDiff history", mode = "v", desc = "Toggle git log of selected lines" }, { "gL", "CodeDiff history", desc = "Toggle git log of current branch" }, }, }