[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70616":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},70616,"diffview.nvim","sindrets\u002Fdiffview.nvim","sindrets","Single tabpage interface for easily cycling through diffs for all modified files for any git rev.","",null,"Lua",5620,194,14,104,0,8,18,65,24,37.87,"Other",false,"main",true,[27,28,29,30,31,32],"diff","git","neovim","neovim-lua","neovim-lua-plugin","neovim-plugin","2026-06-12 02:02:35","# Diffview.nvim\n\nSingle tabpage interface for easily cycling through diffs for all modified files\nfor any git rev.\n\n![preview](https:\u002F\u002Fuser-images.githubusercontent.com\u002F2786478\u002F131269942-e34100dd-cbb9-48fe-af31-6e518ce06e9e.png)\n\n\n## Introduction\n\nVim's diff mode is pretty good, but there is no convenient way to quickly bring\nup all modified files in a diffsplit. This plugin aims to provide a simple,\nunified, single tabpage interface that lets you easily review all changed files\nfor any git rev.\n\n## Requirements\n\n- Git ≥ 2.31.0 (for Git support)\n- Mercurial ≥ 5.4.0 (for Mercurial support)\n- Neovim ≥ 0.7.0 (with LuaJIT)\n- [nvim-web-devicons](https:\u002F\u002Fgithub.com\u002Fnvim-tree\u002Fnvim-web-devicons) (optional) For file icons\n\n## Installation\n\nInstall the plugin with your package manager of choice.\n\n```vim\n\" Plug\nPlug 'sindrets\u002Fdiffview.nvim'\n```\n\n```lua\n-- Packer\nuse \"sindrets\u002Fdiffview.nvim\" \n```\n\n## Merge Tool\n\n![merge tool showcase](https:\u002F\u002Fuser-images.githubusercontent.com\u002F2786478\u002F188286293-13bbf0ab-3595-425d-ba4a-12f514c17eb6.png)\n\nOpening a diff view during a merge or a rebase will list the conflicted files in\ntheir own section. When opening a conflicted file, it will open in a 3-way diff\nallowing you to resolve the merge conflicts with the context of the target\nbranch's version, as well as the version from the branch which is being merged.\n\nThe 3-way diff is only the default layout for merge conflicts. There are\nmultiple variations on this layout, a 4-way diff layout, and a single window\nlayout available.\n\nIn addition to the normal `:h copy-diffs` mappings, there are default mappings\nprovided for jumping between conflict markers, obtaining a hunk directly from\nany of the diff buffers, and accepting any one, all, or none of the versions of\na file given by a conflict region.\n\nFor more information on the merge tool, mappings, layouts and how to\nconfigure them, see:\n\n- `:h diffview-merge-tool`\n- `:h diffview-config-view.x.layout`\n\n## File History\n\n![file history showcase](https:\u002F\u002Fuser-images.githubusercontent.com\u002F2786478\u002F188331057-f9ec9a0d-8cda-4ff8-ac98-febcc7aa4010.png)\n\nThe file history view allows you to list all the commits that affected a given\nset of paths, and view the changes made in a diff split. This is a porcelain\ninterface for git-log, and supports a good number of its options. Things like:\n\n- Filtering commits by grepping commit messages and commit authors.\n- Tracing the line evolution of a given set of line ranges for multiple files.\n- Only listing changes for a specific commit range, branch, or tag.\n- Following file changes through renames.\n\nGet started by opening file history for:\n\n- The current branch: `:DiffviewFileHistory`\n- The current file: `:DiffviewFileHistory %`\n\nFor more info, see `:h :DiffviewFileHistory`.\n\n## Usage\n\n### `:DiffviewOpen [git rev] [options] [ -- {paths...}]`\n\nCalling `:DiffviewOpen` with no args opens a new Diffview that compares against\nthe current index. You can also provide any valid git rev to view only changes\nfor that rev.\n\nExamples:\n\n- `:DiffviewOpen`\n- `:DiffviewOpen HEAD~2`\n- `:DiffviewOpen HEAD~4..HEAD~2`\n- `:DiffviewOpen d4a7b0d`\n- `:DiffviewOpen d4a7b0d^!`\n- `:DiffviewOpen d4a7b0d..519b30e`\n- `:DiffviewOpen origin\u002Fmain...HEAD`\n\nYou can also provide additional paths to narrow down what files are shown:\n\n- `:DiffviewOpen HEAD~2 -- lua\u002Fdiffview plugin`\n\nFor information about additional `[options]`, visit the\n[documentation](https:\u002F\u002Fgithub.com\u002Fsindrets\u002Fdiffview.nvim\u002Fblob\u002Fmain\u002Fdoc\u002Fdiffview.txt).\n\nAdditional commands for convenience:\n\n- `:DiffviewClose`: Close the current diffview. You can also use `:tabclose`.\n- `:DiffviewToggleFiles`: Toggle the file panel.\n- `:DiffviewFocusFiles`: Bring focus to the file panel.\n- `:DiffviewRefresh`: Update stats and entries in the file list of the current\n  Diffview.\n\nWith a Diffview open and the default key bindings, you can cycle through changed\nfiles with `\u003Ctab>` and `\u003Cs-tab>` (see configuration to change the key bindings).\n\n#### Staging\n\nYou can stage individual hunks by editing any buffer that represents the index\n(after running `:DiffviewOpen` with no `[git-rev]` the entries under \"Changes\"\nwill have the index buffer on the left side, and the entries under \"Staged\nchanges\" will have it on the right side). Once you write to an index buffer the\nindex will be updated.\n\n### `:[range]DiffviewFileHistory [paths] [options]`\n\nOpens a new file history view that lists all commits that affected the given\npaths. This is a porcelain interface for git-log. Both `[paths]` and\n`[options]` may be specified in any order, even interchangeably.\n\nIf no `[paths]` are given, defaults to the top-level of the working tree. The\ntop-level will be inferred from the current buffer when possible, otherwise the\ncwd is used. Multiple `[paths]` may be provided and git pathspec is supported.\n\nIf `[range]` is given, the file history view will trace the line evolution of the\ngiven range in the current file (for more info, see the `-L` flag in the docs).\n\nExamples:\n\n- `:DiffviewFileHistory`\n- `:DiffviewFileHistory %`\n- `:DiffviewFileHistory path\u002Fto\u002Fsome\u002Ffile.txt`\n- `:DiffviewFileHistory path\u002Fto\u002Fsome\u002Fdirectory`\n- `:DiffviewFileHistory include\u002Fthis and\u002Fthis :!but\u002Fnot\u002Fthis`\n- `:DiffviewFileHistory --range=origin..HEAD`\n- `:DiffviewFileHistory --range=feat\u002Fexample-branch`\n- `:'\u003C,'>DiffviewFileHistory`\n\n> [!IMPORTANT]\n> ### Familiarize Yourself With `:h diff-mode`\n>\n> This plugin assumes you're familiar with all the features already provided by\n> nvim's builtin diff-mode. These features include:\n>\n> - Jumping between hunks (`:h jumpto-diffs`).\n> - Applying the changes of a diff hunk from any of the diffed buffers\n>   (`:h copy-diffs`).\n> - And more...\n>\n> Read the help page for more info.\n\n---\n\n\u003Cbr>\n\n> [!NOTE]\n> Additionally check out [USAGE](USAGE.md) for examples of some more specific\n> use-cases.\n\n\u003Cbr>\n\n---\n\n## Configuration\n\n\u003Cp>\n\u003Cdetails>\n\u003Csummary style='cursor: pointer'>\u003Cb>Example config with default values\u003C\u002Fb>\u003C\u002Fsummary>\n\n```lua\n-- Lua\nlocal actions = require(\"diffview.actions\")\n\nrequire(\"diffview\").setup({\n  diff_binaries = false,    -- Show diffs for binaries\n  enhanced_diff_hl = false, -- See |diffview-config-enhanced_diff_hl|\n  git_cmd = { \"git\" },      -- The git executable followed by default args.\n  hg_cmd = { \"hg\" },        -- The hg executable followed by default args.\n  use_icons = true,         -- Requires nvim-web-devicons\n  show_help_hints = true,   -- Show hints for how to open the help panel\n  watch_index = true,       -- Update views and index buffers when the git index changes.\n  icons = {                 -- Only applies when use_icons is true.\n    folder_closed = \"\",\n    folder_open = \"\",\n  },\n  signs = {\n    fold_closed = \"\",\n    fold_open = \"\",\n    done = \"✓\",\n  },\n  view = {\n    -- Configure the layout and behavior of different types of views.\n    -- Available layouts:\n    --  'diff1_plain'\n    --    |'diff2_horizontal'\n    --    |'diff2_vertical'\n    --    |'diff3_horizontal'\n    --    |'diff3_vertical'\n    --    |'diff3_mixed'\n    --    |'diff4_mixed'\n    -- For more info, see |diffview-config-view.x.layout|.\n    default = {\n      -- Config for changed files, and staged files in diff views.\n      layout = \"diff2_horizontal\",\n      disable_diagnostics = false,  -- Temporarily disable diagnostics for diff buffers while in the view.\n      winbar_info = false,          -- See |diffview-config-view.x.winbar_info|\n    },\n    merge_tool = {\n      -- Config for conflicted files in diff views during a merge or rebase.\n      layout = \"diff3_horizontal\",\n      disable_diagnostics = true,   -- Temporarily disable diagnostics for diff buffers while in the view.\n      winbar_info = true,           -- See |diffview-config-view.x.winbar_info|\n    },\n    file_history = {\n      -- Config for changed files in file history views.\n      layout = \"diff2_horizontal\",\n      disable_diagnostics = false,  -- Temporarily disable diagnostics for diff buffers while in the view.\n      winbar_info = false,          -- See |diffview-config-view.x.winbar_info|\n    },\n  },\n  file_panel = {\n    listing_style = \"tree\",             -- One of 'list' or 'tree'\n    tree_options = {                    -- Only applies when listing_style is 'tree'\n      flatten_dirs = true,              -- Flatten dirs that only contain one single dir\n      folder_statuses = \"only_folded\",  -- One of 'never', 'only_folded' or 'always'.\n    },\n    win_config = {                      -- See |diffview-config-win_config|\n      position = \"left\",\n      width = 35,\n      win_opts = {},\n    },\n  },\n  file_history_panel = {\n    log_options = {   -- See |diffview-config-log_options|\n      git = {\n        single_file = {\n          diff_merges = \"combined\",\n        },\n        multi_file = {\n          diff_merges = \"first-parent\",\n        },\n      },\n      hg = {\n        single_file = {},\n        multi_file = {},\n      },\n    },\n    win_config = {    -- See |diffview-config-win_config|\n      position = \"bottom\",\n      height = 16,\n      win_opts = {},\n    },\n  },\n  commit_log_panel = {\n    win_config = {},  -- See |diffview-config-win_config|\n  },\n  default_args = {    -- Default args prepended to the arg-list for the listed commands\n    DiffviewOpen = {},\n    DiffviewFileHistory = {},\n  },\n  hooks = {},         -- See |diffview-config-hooks|\n  keymaps = {\n    disable_defaults = false, -- Disable the default keymaps\n    view = {\n      -- The `view` bindings are active in the diff buffers, only when the current\n      -- tabpage is a Diffview.\n      { \"n\", \"\u003Ctab>\",       actions.select_next_entry,              { desc = \"Open the diff for the next file\" } },\n      { \"n\", \"\u003Cs-tab>\",     actions.select_prev_entry,              { desc = \"Open the diff for the previous file\" } },\n      { \"n\", \"[F\",          actions.select_first_entry,             { desc = \"Open the diff for the first file\" } },\n      { \"n\", \"]F\",          actions.select_last_entry,              { desc = \"Open the diff for the last file\" } },\n      { \"n\", \"gf\",          actions.goto_file_edit,                 { desc = \"Open the file in the previous tabpage\" } },\n      { \"n\", \"\u003CC-w>\u003CC-f>\",  actions.goto_file_split,                { desc = \"Open the file in a new split\" } },\n      { \"n\", \"\u003CC-w>gf\",     actions.goto_file_tab,                  { desc = \"Open the file in a new tabpage\" } },\n      { \"n\", \"\u003Cleader>e\",   actions.focus_files,                    { desc = \"Bring focus to the file panel\" } },\n      { \"n\", \"\u003Cleader>b\",   actions.toggle_files,                   { desc = \"Toggle the file panel.\" } },\n      { \"n\", \"g\u003CC-x>\",      actions.cycle_layout,                   { desc = \"Cycle through available layouts.\" } },\n      { \"n\", \"[x\",          actions.prev_conflict,                  { desc = \"In the merge-tool: jump to the previous conflict\" } },\n      { \"n\", \"]x\",          actions.next_conflict,                  { desc = \"In the merge-tool: jump to the next conflict\" } },\n      { \"n\", \"\u003Cleader>co\",  actions.conflict_choose(\"ours\"),        { desc = \"Choose the OURS version of a conflict\" } },\n      { \"n\", \"\u003Cleader>ct\",  actions.conflict_choose(\"theirs\"),      { desc = \"Choose the THEIRS version of a conflict\" } },\n      { \"n\", \"\u003Cleader>cb\",  actions.conflict_choose(\"base\"),        { desc = \"Choose the BASE version of a conflict\" } },\n      { \"n\", \"\u003Cleader>ca\",  actions.conflict_choose(\"all\"),         { desc = \"Choose all the versions of a conflict\" } },\n      { \"n\", \"dx\",          actions.conflict_choose(\"none\"),        { desc = \"Delete the conflict region\" } },\n      { \"n\", \"\u003Cleader>cO\",  actions.conflict_choose_all(\"ours\"),    { desc = \"Choose the OURS version of a conflict for the whole file\" } },\n      { \"n\", \"\u003Cleader>cT\",  actions.conflict_choose_all(\"theirs\"),  { desc = \"Choose the THEIRS version of a conflict for the whole file\" } },\n      { \"n\", \"\u003Cleader>cB\",  actions.conflict_choose_all(\"base\"),    { desc = \"Choose the BASE version of a conflict for the whole file\" } },\n      { \"n\", \"\u003Cleader>cA\",  actions.conflict_choose_all(\"all\"),     { desc = \"Choose all the versions of a conflict for the whole file\" } },\n      { \"n\", \"dX\",          actions.conflict_choose_all(\"none\"),    { desc = \"Delete the conflict region for the whole file\" } },\n    },\n    diff1 = {\n      -- Mappings in single window diff layouts\n      { \"n\", \"g?\", actions.help({ \"view\", \"diff1\" }), { desc = \"Open the help panel\" } },\n    },\n    diff2 = {\n      -- Mappings in 2-way diff layouts\n      { \"n\", \"g?\", actions.help({ \"view\", \"diff2\" }), { desc = \"Open the help panel\" } },\n    },\n    diff3 = {\n      -- Mappings in 3-way diff layouts\n      { { \"n\", \"x\" }, \"2do\",  actions.diffget(\"ours\"),            { desc = \"Obtain the diff hunk from the OURS version of the file\" } },\n      { { \"n\", \"x\" }, \"3do\",  actions.diffget(\"theirs\"),          { desc = \"Obtain the diff hunk from the THEIRS version of the file\" } },\n      { \"n\",          \"g?\",   actions.help({ \"view\", \"diff3\" }),  { desc = \"Open the help panel\" } },\n    },\n    diff4 = {\n      -- Mappings in 4-way diff layouts\n      { { \"n\", \"x\" }, \"1do\",  actions.diffget(\"base\"),            { desc = \"Obtain the diff hunk from the BASE version of the file\" } },\n      { { \"n\", \"x\" }, \"2do\",  actions.diffget(\"ours\"),            { desc = \"Obtain the diff hunk from the OURS version of the file\" } },\n      { { \"n\", \"x\" }, \"3do\",  actions.diffget(\"theirs\"),          { desc = \"Obtain the diff hunk from the THEIRS version of the file\" } },\n      { \"n\",          \"g?\",   actions.help({ \"view\", \"diff4\" }),  { desc = \"Open the help panel\" } },\n    },\n    file_panel = {\n      { \"n\", \"j\",              actions.next_entry,                     { desc = \"Bring the cursor to the next file entry\" } },\n      { \"n\", \"\u003Cdown>\",         actions.next_entry,                     { desc = \"Bring the cursor to the next file entry\" } },\n      { \"n\", \"k\",              actions.prev_entry,                     { desc = \"Bring the cursor to the previous file entry\" } },\n      { \"n\", \"\u003Cup>\",           actions.prev_entry,                     { desc = \"Bring the cursor to the previous file entry\" } },\n      { \"n\", \"\u003Ccr>\",           actions.select_entry,                   { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"o\",              actions.select_entry,                   { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"l\",              actions.select_entry,                   { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"\u003C2-LeftMouse>\",  actions.select_entry,                   { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"-\",              actions.toggle_stage_entry,             { desc = \"Stage \u002F unstage the selected entry\" } },\n      { \"n\", \"s\",              actions.toggle_stage_entry,             { desc = \"Stage \u002F unstage the selected entry\" } },\n      { \"n\", \"S\",              actions.stage_all,                      { desc = \"Stage all entries\" } },\n      { \"n\", \"U\",              actions.unstage_all,                    { desc = \"Unstage all entries\" } },\n      { \"n\", \"X\",              actions.restore_entry,                  { desc = \"Restore entry to the state on the left side\" } },\n      { \"n\", \"L\",              actions.open_commit_log,                { desc = \"Open the commit log panel\" } },\n      { \"n\", \"zo\",             actions.open_fold,                      { desc = \"Expand fold\" } },\n      { \"n\", \"h\",              actions.close_fold,                     { desc = \"Collapse fold\" } },\n      { \"n\", \"zc\",             actions.close_fold,                     { desc = \"Collapse fold\" } },\n      { \"n\", \"za\",             actions.toggle_fold,                    { desc = \"Toggle fold\" } },\n      { \"n\", \"zR\",             actions.open_all_folds,                 { desc = \"Expand all folds\" } },\n      { \"n\", \"zM\",             actions.close_all_folds,                { desc = \"Collapse all folds\" } },\n      { \"n\", \"\u003Cc-b>\",          actions.scroll_view(-0.25),             { desc = \"Scroll the view up\" } },\n      { \"n\", \"\u003Cc-f>\",          actions.scroll_view(0.25),              { desc = \"Scroll the view down\" } },\n      { \"n\", \"\u003Ctab>\",          actions.select_next_entry,              { desc = \"Open the diff for the next file\" } },\n      { \"n\", \"\u003Cs-tab>\",        actions.select_prev_entry,              { desc = \"Open the diff for the previous file\" } },\n      { \"n\", \"[F\",             actions.select_first_entry,             { desc = \"Open the diff for the first file\" } },\n      { \"n\", \"]F\",             actions.select_last_entry,              { desc = \"Open the diff for the last file\" } },\n      { \"n\", \"gf\",             actions.goto_file_edit,                 { desc = \"Open the file in the previous tabpage\" } },\n      { \"n\", \"\u003CC-w>\u003CC-f>\",     actions.goto_file_split,                { desc = \"Open the file in a new split\" } },\n      { \"n\", \"\u003CC-w>gf\",        actions.goto_file_tab,                  { desc = \"Open the file in a new tabpage\" } },\n      { \"n\", \"i\",              actions.listing_style,                  { desc = \"Toggle between 'list' and 'tree' views\" } },\n      { \"n\", \"f\",              actions.toggle_flatten_dirs,            { desc = \"Flatten empty subdirectories in tree listing style\" } },\n      { \"n\", \"R\",              actions.refresh_files,                  { desc = \"Update stats and entries in the file list\" } },\n      { \"n\", \"\u003Cleader>e\",      actions.focus_files,                    { desc = \"Bring focus to the file panel\" } },\n      { \"n\", \"\u003Cleader>b\",      actions.toggle_files,                   { desc = \"Toggle the file panel\" } },\n      { \"n\", \"g\u003CC-x>\",         actions.cycle_layout,                   { desc = \"Cycle available layouts\" } },\n      { \"n\", \"[x\",             actions.prev_conflict,                  { desc = \"Go to the previous conflict\" } },\n      { \"n\", \"]x\",             actions.next_conflict,                  { desc = \"Go to the next conflict\" } },\n      { \"n\", \"g?\",             actions.help(\"file_panel\"),             { desc = \"Open the help panel\" } },\n      { \"n\", \"\u003Cleader>cO\",     actions.conflict_choose_all(\"ours\"),    { desc = \"Choose the OURS version of a conflict for the whole file\" } },\n      { \"n\", \"\u003Cleader>cT\",     actions.conflict_choose_all(\"theirs\"),  { desc = \"Choose the THEIRS version of a conflict for the whole file\" } },\n      { \"n\", \"\u003Cleader>cB\",     actions.conflict_choose_all(\"base\"),    { desc = \"Choose the BASE version of a conflict for the whole file\" } },\n      { \"n\", \"\u003Cleader>cA\",     actions.conflict_choose_all(\"all\"),     { desc = \"Choose all the versions of a conflict for the whole file\" } },\n      { \"n\", \"dX\",             actions.conflict_choose_all(\"none\"),    { desc = \"Delete the conflict region for the whole file\" } },\n    },\n    file_history_panel = {\n      { \"n\", \"g!\",            actions.options,                     { desc = \"Open the option panel\" } },\n      { \"n\", \"\u003CC-A-d>\",       actions.open_in_diffview,            { desc = \"Open the entry under the cursor in a diffview\" } },\n      { \"n\", \"y\",             actions.copy_hash,                   { desc = \"Copy the commit hash of the entry under the cursor\" } },\n      { \"n\", \"L\",             actions.open_commit_log,             { desc = \"Show commit details\" } },\n      { \"n\", \"X\",             actions.restore_entry,               { desc = \"Restore file to the state from the selected entry\" } },\n      { \"n\", \"zo\",            actions.open_fold,                   { desc = \"Expand fold\" } },\n      { \"n\", \"zc\",            actions.close_fold,                  { desc = \"Collapse fold\" } },\n      { \"n\", \"h\",             actions.close_fold,                  { desc = \"Collapse fold\" } },\n      { \"n\", \"za\",            actions.toggle_fold,                 { desc = \"Toggle fold\" } },\n      { \"n\", \"zR\",            actions.open_all_folds,              { desc = \"Expand all folds\" } },\n      { \"n\", \"zM\",            actions.close_all_folds,             { desc = \"Collapse all folds\" } },\n      { \"n\", \"j\",             actions.next_entry,                  { desc = \"Bring the cursor to the next file entry\" } },\n      { \"n\", \"\u003Cdown>\",        actions.next_entry,                  { desc = \"Bring the cursor to the next file entry\" } },\n      { \"n\", \"k\",             actions.prev_entry,                  { desc = \"Bring the cursor to the previous file entry\" } },\n      { \"n\", \"\u003Cup>\",          actions.prev_entry,                  { desc = \"Bring the cursor to the previous file entry\" } },\n      { \"n\", \"\u003Ccr>\",          actions.select_entry,                { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"o\",             actions.select_entry,                { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"l\",             actions.select_entry,                { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"\u003C2-LeftMouse>\", actions.select_entry,                { desc = \"Open the diff for the selected entry\" } },\n      { \"n\", \"\u003Cc-b>\",         actions.scroll_view(-0.25),          { desc = \"Scroll the view up\" } },\n      { \"n\", \"\u003Cc-f>\",         actions.scroll_view(0.25),           { desc = \"Scroll the view down\" } },\n      { \"n\", \"\u003Ctab>\",         actions.select_next_entry,           { desc = \"Open the diff for the next file\" } },\n      { \"n\", \"\u003Cs-tab>\",       actions.select_prev_entry,           { desc = \"Open the diff for the previous file\" } },\n      { \"n\", \"[F\",            actions.select_first_entry,          { desc = \"Open the diff for the first file\" } },\n      { \"n\", \"]F\",            actions.select_last_entry,           { desc = \"Open the diff for the last file\" } },\n      { \"n\", \"gf\",            actions.goto_file_edit,              { desc = \"Open the file in the previous tabpage\" } },\n      { \"n\", \"\u003CC-w>\u003CC-f>\",    actions.goto_file_split,             { desc = \"Open the file in a new split\" } },\n      { \"n\", \"\u003CC-w>gf\",       actions.goto_file_tab,               { desc = \"Open the file in a new tabpage\" } },\n      { \"n\", \"\u003Cleader>e\",     actions.focus_files,                 { desc = \"Bring focus to the file panel\" } },\n      { \"n\", \"\u003Cleader>b\",     actions.toggle_files,                { desc = \"Toggle the file panel\" } },\n      { \"n\", \"g\u003CC-x>\",        actions.cycle_layout,                { desc = \"Cycle available layouts\" } },\n      { \"n\", \"g?\",            actions.help(\"file_history_panel\"),  { desc = \"Open the help panel\" } },\n    },\n    option_panel = {\n      { \"n\", \"\u003Ctab>\", actions.select_entry,          { desc = \"Change the current option\" } },\n      { \"n\", \"q\",     actions.close,                 { desc = \"Close the panel\" } },\n      { \"n\", \"g?\",    actions.help(\"option_panel\"),  { desc = \"Open the help panel\" } },\n    },\n    help_panel = {\n      { \"n\", \"q\",     actions.close,  { desc = \"Close help menu\" } },\n      { \"n\", \"\u003Cesc>\", actions.close,  { desc = \"Close help menu\" } },\n    },\n  },\n})\n```\n\n\u003C\u002Fdetails>\n\u003C\u002Fp>\n\n### Hooks\n\nThe `hooks` table allows you to define callbacks for various events emitted from\nDiffview. The available hooks are documented in detail in\n`:h diffview-config-hooks`. The hook events are also available as User\nautocommands. See `:h diffview-user-autocmds` for more details.\n\nExamples:\n\n```lua\nhooks = {\n  diff_buf_read = function(bufnr)\n    -- Change local options in diff buffers\n    vim.opt_local.wrap = false\n    vim.opt_local.list = false\n    vim.opt_local.colorcolumn = { 80 }\n  end,\n  view_opened = function(view)\n    print(\n      (\"A new %s was opened on tab page %d!\")\n      :format(view.class:name(), view.tabpage)\n    )\n  end,\n}\n```\n\n### Keymaps\n\nThe keymaps config is structured as a table with sub-tables for various\ndifferent contexts where mappings can be declared. In these sub-tables\nkey-value pairs are treated as the `{lhs}` and `{rhs}` of a normal mode\nmapping. These mappings all use the `:map-arguments` `silent`, `nowait`, and\n`noremap`. The implementation uses `vim.keymap.set()`, so the `{rhs}` can be\neither a vim command in the form of a string, or it can be a lua function:\n\n```lua\n  view = {\n    -- Vim command:\n    [\"a\"] = \"\u003CCmd>echom 'foo'\u003CCR>\",\n    -- Lua function:\n    [\"b\"] = function() print(\"bar\") end,\n  }\n```\n\nFor more control (i.e. mappings for other modes), you can also define index\nvalues as list-like tables containing the arguments for `vim.keymap.set()`.\nThis way you can also change all the `:map-arguments` with the only exception\nbeing the `buffer` field, as this will be overridden with the target buffer\nnumber:\n\n```lua\nview = {\n  -- Normal and visual mode mapping to vim command:\n  { { \"n\", \"v\" }, \"\u003Cleader>a\", \"\u003CCmd>echom 'foo'\u003CCR>\", { silent = true } },\n  -- Visual mode mapping to lua function:\n  { \"v\", \"\u003Cleader>b\", function() print(\"bar\") end, { nowait = true } },\n}\n```\n\nTo disable any single mapping without disabling them all, set its `{rhs}` to\n`false`:\n\n```lua\n  view = {\n    -- Disable the default normal mode mapping for `\u003Ctab>`:\n    [\"\u003Ctab>\"] = false,\n    -- Disable the default visual mode mapping for `gf`:\n    { \"x\", \"gf\", false },\n  }\n```\n\nMost of the mapped file panel actions also work from the view if they are added\nto the view maps (and vice versa). The exception is for actions that only\nreally make sense specifically in the file panel, such as `next_entry`,\n`prev_entry`. Actions such as `toggle_stage_entry` and `restore_entry` work\njust fine from the view. When invoked from the view, these will target the file\ncurrently open in the view rather than the file under the cursor in the file\npanel.\n\n**For more details on how to set mappings for other modes, actions, and more see:**\n- `:h diffview-config-keymaps`\n- `:h diffview-actions`\n\n## Restoring Files\n\nIf the right side of the diff is showing the local state of a file, you can\nrestore the file to the state from the left side of the diff (key binding `X`\nfrom the file panel by default). The current state of the file is stored in the\ngit object database, and a command is echoed that shows how to undo the change.\n\n## Tips and FAQ\n\n- **Hide untracked files:**\n  - `DiffviewOpen -uno`\n- **Exclude certain paths:**\n  - `DiffviewOpen -- :!exclude\u002Fthis :!and\u002Fthis`\n- **Run as if git was started in a specific directory:**\n  - `DiffviewOpen -C\u002Ffoo\u002Fbar\u002Fbaz`\n- **Diff the index against a git rev:**\n  - `DiffviewOpen HEAD~2 --cached`\n  - Defaults to `HEAD` if no rev is given.\n- **Q: How do I get the diagonal lines in place of deleted lines in\n  diff-mode?**\n  - A: Change your `:h 'fillchars'`:\n    - (vimscript): `set fillchars+=diff:╱`\n    - (Lua): `vim.opt.fillchars:append { diff = \"╱\" }`\n  - Note: whether or not the diagonal lines will line up nicely will depend on\n    your terminal emulator. The terminal used in the screenshots is Kitty.\n- **Q: How do I jump between hunks in the diff?**\n  - A: Use `[c` and `]c`\n  - `:h jumpto-diffs`\n\n\u003C!-- vim: set tw=80 -->\n","Diffview.nvim 是一个用于在单个标签页中轻松浏览所有修改文件差异的 Neovim 插件。它提供了一个简洁统一的界面，支持用户快速查看任意 Git 版本下的所有变更文件，并且具备强大的合并工具功能，能够以三路或四路差异视图帮助解决合并冲突。此外，该插件还提供了文件历史记录查看功能，允许用户追踪特定路径的历史提交和文件重命名等信息。适用于需要频繁进行代码审查、版本对比及冲突解决的开发者，特别是那些使用 Neovim 作为主要开发环境的人士。",2,"2026-06-11 03:33:00","high_star"]