@@ -183,7 +183,7 @@ local actions = require("diffview.actions")
183183
184184require (" diffview" ).setup ({
185185 diff_binaries = false , -- Show diffs for binaries
186- enhanced_diff_hl = false , -- See ':h diffview-config-enhanced_diff_hl'
186+ enhanced_diff_hl = false , -- See | diffview-config-enhanced_diff_hl|
187187 git_cmd = { " git" }, -- The git executable followed by default args.
188188 hg_cmd = { " hg" }, -- The hg executable followed by default args.
189189 use_icons = true , -- Requires nvim-web-devicons
@@ -208,22 +208,24 @@ require("diffview").setup({
208208 -- |'diff3_vertical'
209209 -- |'diff3_mixed'
210210 -- |'diff4_mixed'
211- -- For more info, see ':h diffview-config-view.x.layout' .
211+ -- For more info, see | diffview-config-view.x.layout| .
212212 default = {
213213 -- Config for changed files, and staged files in diff views.
214214 layout = " diff2_horizontal" ,
215- winbar_info = false , -- See ':h diffview-config-view.x.winbar_info'
215+ disable_diagnostics = false , -- Temporarily disable diagnostics for diff buffers while in the view.
216+ winbar_info = false , -- See |diffview-config-view.x.winbar_info|
216217 },
217218 merge_tool = {
218219 -- Config for conflicted files in diff views during a merge or rebase.
219220 layout = " diff3_horizontal" ,
220- disable_diagnostics = true , -- Temporarily disable diagnostics for conflict buffers while in the view.
221- winbar_info = true , -- See ':h diffview-config-view.x.winbar_info'
221+ disable_diagnostics = true , -- Temporarily disable diagnostics for diff buffers while in the view.
222+ winbar_info = true , -- See | diffview-config-view.x.winbar_info|
222223 },
223224 file_history = {
224225 -- Config for changed files in file history views.
225226 layout = " diff2_horizontal" ,
226- winbar_info = false , -- See ':h diffview-config-view.x.winbar_info'
227+ disable_diagnostics = false , -- Temporarily disable diagnostics for diff buffers while in the view.
228+ winbar_info = false , -- See |diffview-config-view.x.winbar_info|
227229 },
228230 },
229231 file_panel = {
@@ -232,14 +234,14 @@ require("diffview").setup({
232234 flatten_dirs = true , -- Flatten dirs that only contain one single dir
233235 folder_statuses = " only_folded" , -- One of 'never', 'only_folded' or 'always'.
234236 },
235- win_config = { -- See ':h diffview-config-win_config'
237+ win_config = { -- See | diffview-config-win_config|
236238 position = " left" ,
237239 width = 35 ,
238- win_opts = {}
240+ win_opts = {},
239241 },
240242 },
241243 file_history_panel = {
242- log_options = { -- See ':h diffview-config-log_options'
244+ log_options = { -- See | diffview-config-log_options|
243245 git = {
244246 single_file = {
245247 diff_merges = " combined" ,
@@ -253,22 +255,20 @@ require("diffview").setup({
253255 multi_file = {},
254256 },
255257 },
256- win_config = { -- See ':h diffview-config-win_config'
258+ win_config = { -- See | diffview-config-win_config|
257259 position = " bottom" ,
258260 height = 16 ,
259- win_opts = {}
261+ win_opts = {},
260262 },
261263 },
262264 commit_log_panel = {
263- win_config = { -- See ':h diffview-config-win_config'
264- win_opts = {},
265- }
265+ win_config = {}, -- See |diffview-config-win_config|
266266 },
267267 default_args = { -- Default args prepended to the arg-list for the listed commands
268268 DiffviewOpen = {},
269269 DiffviewFileHistory = {},
270270 },
271- hooks = {}, -- See ':h diffview-config-hooks'
271+ hooks = {}, -- See | diffview-config-hooks|
272272 keymaps = {
273273 disable_defaults = false , -- Disable the default keymaps
274274 view = {
@@ -364,15 +364,23 @@ require("diffview").setup({
364364 { " n" , " <C-A-d>" , actions .open_in_diffview , { desc = " Open the entry under the cursor in a diffview" } },
365365 { " n" , " y" , actions .copy_hash , { desc = " Copy the commit hash of the entry under the cursor" } },
366366 { " n" , " L" , actions .open_commit_log , { desc = " Show commit details" } },
367+ { " n" , " X" , actions .restore_entry , { desc = " Restore file to the state from the selected entry" } },
368+ { " n" , " zr" , actions .open_fold , { desc = " Expand fold" } },
369+ { " n" , " zo" , actions .open_fold , { desc = " Expand fold" } },
370+ { " n" , " zm" , actions .close_fold , { desc = " Collapse fold" } },
371+ { " n" , " zc" , actions .close_fold , { desc = " Collapse fold" } },
372+ { " n" , " h" , actions .close_fold , { desc = " Collapse fold" } },
373+ { " n" , " za" , actions .toggle_fold , { desc = " Toggle fold" } },
367374 { " n" , " zR" , actions .open_all_folds , { desc = " Expand all folds" } },
368375 { " n" , " zM" , actions .close_all_folds , { desc = " Collapse all folds" } },
369376 { " n" , " j" , actions .next_entry , { desc = " Bring the cursor to the next file entry" } },
370377 { " n" , " <down>" , actions .next_entry , { desc = " Bring the cursor to the next file entry" } },
371- { " n" , " k" , actions .prev_entry , { desc = " Bring the cursor to the previous file entry." } },
372- { " n" , " <up>" , actions .prev_entry , { desc = " Bring the cursor to the previous file entry." } },
373- { " n" , " <cr>" , actions .select_entry , { desc = " Open the diff for the selected entry." } },
374- { " n" , " o" , actions .select_entry , { desc = " Open the diff for the selected entry." } },
375- { " n" , " <2-LeftMouse>" , actions .select_entry , { desc = " Open the diff for the selected entry." } },
378+ { " n" , " k" , actions .prev_entry , { desc = " Bring the cursor to the previous file entry" } },
379+ { " n" , " <up>" , actions .prev_entry , { desc = " Bring the cursor to the previous file entry" } },
380+ { " n" , " <cr>" , actions .select_entry , { desc = " Open the diff for the selected entry" } },
381+ { " n" , " o" , actions .select_entry , { desc = " Open the diff for the selected entry" } },
382+ { " n" , " l" , actions .select_entry , { desc = " Open the diff for the selected entry" } },
383+ { " n" , " <2-LeftMouse>" , actions .select_entry , { desc = " Open the diff for the selected entry" } },
376384 { " n" , " <c-b>" , actions .scroll_view (- 0.25 ), { desc = " Scroll the view up" } },
377385 { " n" , " <c-f>" , actions .scroll_view (0.25 ), { desc = " Scroll the view down" } },
378386 { " n" , " <tab>" , actions .select_next_entry , { desc = " Open the diff for the next file" } },
0 commit comments