Closed victorscomma closed 11 months ago
The right config is opts.view.file_history.layout
require("diffview").setup({
view = {
file_history = {
layout = "diff2_vertical",
},
},
})
But this does not swap the boxes. If you want to swap the boxes you could use one of the hooks and play a little with wincmd
:
require("diffview").setup({
hooks = {
view_opened = function(view)
if(view.class:name() == 'FileHistoryView') then
vim.cmd('wincmd k')
vim.cmd('wincmd x')
vim.cmd('wincmd j')
end
end,
}
})
thank you @tummetott works perfect!
Is it possible to change the file history layouts? I tried all of the below but none of them appear to effect the code/diff boxes in file_history
Ideally I was hoping to keep it horizontal but swap the boxes, but was just testing with vertical to see if I can get it working.
I like using the command
:DiffviewFileHistory --base=LOCAL %
and I wanted to try to keep my local state on the left since it feels a little more natural.Thanks for any assistance