@@ -38,16 +38,25 @@ Example configuration with default settings:
38
38
local cb = require'diffview.config'.diffview_callback
39
39
require'diffview'.setup {
40
40
diff_binaries = false, -- Show diffs for binaries
41
- use_icons = true, -- Requires nvim-web-devicons
42
41
enhanced_diff_hl = false, -- See |diffview-config-enhanced_diff_hl|
42
+ use_icons = true, -- Requires nvim-web-devicons
43
+ icons = { -- Only applies when use_icons is true.
44
+ folder_closed = "",
45
+ folder_open = "",
46
+ },
43
47
signs = {
44
48
fold_closed = "",
45
49
fold_open = "",
46
50
},
47
51
file_panel = {
48
- position = "left", -- One of 'left', 'right', 'top', 'bottom'
49
- width = 35, -- Only applies when position is 'left' or 'right'
50
- height = 10, -- Only applies when position is 'top' or 'bottom'
52
+ position = "left", -- One of 'left', 'right', 'top', 'bottom'
53
+ width = 35, -- Only applies when position is 'left' or 'right'
54
+ height = 10, -- Only applies when position is 'top' or 'bottom'
55
+ listing_style = "tree", -- One of 'list' or 'tree'
56
+ tree_options = { -- Only applies when listing_style is 'tree'
57
+ flatten_dirs = true,
58
+ folder_statuses = "always" -- One of 'never', 'only_folded' or 'always'.
59
+ }
51
60
},
52
61
file_history_panel = {
53
62
position = "bottom",
@@ -76,23 +85,25 @@ Example configuration with default settings:
76
85
["<leader>b"] = cb("toggle_files"), -- Toggle the files panel.
77
86
},
78
87
file_panel = {
79
- ["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
88
+ ["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
80
89
["<down>"] = cb("next_entry"),
81
- ["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
90
+ ["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
82
91
["<up>"] = cb("prev_entry"),
83
- ["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
92
+ ["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
84
93
["o"] = cb("select_entry"),
85
94
["<2-LeftMouse>"] = cb("select_entry"),
86
- ["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
87
- ["S"] = cb("stage_all"), -- Stage all entries.
88
- ["U"] = cb("unstage_all"), -- Unstage all entries.
89
- ["X"] = cb("restore_entry"), -- Restore entry to the state on the left side.
90
- ["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
95
+ ["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
96
+ ["S"] = cb("stage_all"), -- Stage all entries.
97
+ ["U"] = cb("unstage_all"), -- Unstage all entries.
98
+ ["X"] = cb("restore_entry"), -- Restore entry to the state on the left side.
99
+ ["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
91
100
["<tab>"] = cb("select_next_entry"),
92
101
["<s-tab>"] = cb("select_prev_entry"),
93
102
["gf"] = cb("goto_file"),
94
103
["<C-w><C-f>"] = cb("goto_file_split"),
95
104
["<C-w>gf"] = cb("goto_file_tab"),
105
+ ["i"] = cb("listing_style"), -- Toggle between 'list' and 'tree' views
106
+ ["f"] = cb("toggle_flatten_dirs"), -- Flatten empty subdirectories in tree listing style.
96
107
["<leader>e"] = cb("focus_files"),
97
108
["<leader>b"] = cb("toggle_files"),
98
109
},
0 commit comments