@@ -183,7 +183,7 @@ local actions = require("diffview.actions")
183
183
184
184
require (" diffview" ).setup ({
185
185
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|
187
187
git_cmd = { " git" }, -- The git executable followed by default args.
188
188
hg_cmd = { " hg" }, -- The hg executable followed by default args.
189
189
use_icons = true , -- Requires nvim-web-devicons
@@ -208,22 +208,24 @@ require("diffview").setup({
208
208
-- |'diff3_vertical'
209
209
-- |'diff3_mixed'
210
210
-- |'diff4_mixed'
211
- -- For more info, see ':h diffview-config-view.x.layout' .
211
+ -- For more info, see | diffview-config-view.x.layout| .
212
212
default = {
213
213
-- Config for changed files, and staged files in diff views.
214
214
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|
216
217
},
217
218
merge_tool = {
218
219
-- Config for conflicted files in diff views during a merge or rebase.
219
220
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|
222
223
},
223
224
file_history = {
224
225
-- Config for changed files in file history views.
225
226
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|
227
229
},
228
230
},
229
231
file_panel = {
@@ -232,14 +234,14 @@ require("diffview").setup({
232
234
flatten_dirs = true , -- Flatten dirs that only contain one single dir
233
235
folder_statuses = " only_folded" , -- One of 'never', 'only_folded' or 'always'.
234
236
},
235
- win_config = { -- See ':h diffview-config-win_config'
237
+ win_config = { -- See | diffview-config-win_config|
236
238
position = " left" ,
237
239
width = 35 ,
238
- win_opts = {}
240
+ win_opts = {},
239
241
},
240
242
},
241
243
file_history_panel = {
242
- log_options = { -- See ':h diffview-config-log_options'
244
+ log_options = { -- See | diffview-config-log_options|
243
245
git = {
244
246
single_file = {
245
247
diff_merges = " combined" ,
@@ -253,22 +255,20 @@ require("diffview").setup({
253
255
multi_file = {},
254
256
},
255
257
},
256
- win_config = { -- See ':h diffview-config-win_config'
258
+ win_config = { -- See | diffview-config-win_config|
257
259
position = " bottom" ,
258
260
height = 16 ,
259
- win_opts = {}
261
+ win_opts = {},
260
262
},
261
263
},
262
264
commit_log_panel = {
263
- win_config = { -- See ':h diffview-config-win_config'
264
- win_opts = {},
265
- }
265
+ win_config = {}, -- See |diffview-config-win_config|
266
266
},
267
267
default_args = { -- Default args prepended to the arg-list for the listed commands
268
268
DiffviewOpen = {},
269
269
DiffviewFileHistory = {},
270
270
},
271
- hooks = {}, -- See ':h diffview-config-hooks'
271
+ hooks = {}, -- See | diffview-config-hooks|
272
272
keymaps = {
273
273
disable_defaults = false , -- Disable the default keymaps
274
274
view = {
@@ -364,15 +364,23 @@ require("diffview").setup({
364
364
{ " n" , " <C-A-d>" , actions .open_in_diffview , { desc = " Open the entry under the cursor in a diffview" } },
365
365
{ " n" , " y" , actions .copy_hash , { desc = " Copy the commit hash of the entry under the cursor" } },
366
366
{ " 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" } },
367
374
{ " n" , " zR" , actions .open_all_folds , { desc = " Expand all folds" } },
368
375
{ " n" , " zM" , actions .close_all_folds , { desc = " Collapse all folds" } },
369
376
{ " n" , " j" , actions .next_entry , { desc = " Bring the cursor to the next file entry" } },
370
377
{ " 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" } },
376
384
{ " n" , " <c-b>" , actions .scroll_view (- 0.25 ), { desc = " Scroll the view up" } },
377
385
{ " n" , " <c-f>" , actions .scroll_view (0.25 ), { desc = " Scroll the view down" } },
378
386
{ " n" , " <tab>" , actions .select_next_entry , { desc = " Open the diff for the next file" } },
0 commit comments