Closed emmanueltouzery closed 3 weeks ago
I found a way to achieve that..
require('diffview').setup {
keymaps = {
view = {
["F"] = function() -- jump to first file in the diff
local view = require'diffview.lib'.get_current_view()
view:set_file(view.panel.files[1], false, true)
end,
},
works great!
EDIT this is better:
require('diffview').setup {
keymaps = {
view = {
["F"] = function() -- jump to first file in the diff
local view = require'diffview.lib'.get_current_view()
view:set_file(view.panel:ordered_file_list()[1], false, true)
end,
},
Cool that found a solution! But I think it would still be valuable to have actions for select_[first|last]_entry
, so I'll keep the issue open.
@sindrets I'll have a go adding this feature.
Thank you for creating a very useful plugin.
Hello, I use diffview in a way that I select the current file when opening, using
--selected-file=
. This works great for me.However sometimes I want to use diffview to review all the changes. So, I open the diff view, the current file selected, but I'd like to jump to the first file to go through all the files one by one and be sure I didn't miss any of them. I don't know a way to do that... I know of:
And the equivalent for the previous entry, but how could I jump to the first entry with a single keyboard shortcut? Thank you!