Always open gitv in the same tab.
jordwalke opened this issue · comments
File mode:
It's a little strange that gitv hijacks your current file's window. You may be editing that file and you just want to see the history/diff the history or browse an older version of it.
It seems the ideal flow would be that you can run file-mode and have all the new gitv windows open up somewhere that doesn't touch your main editing window. The simplest place would be a new tab page. That way when you hit diff commands, it doesn't clobber your old window.
Now, I understand how annoying it would be to litter your editing session with gitv windows. Which is why I would suggest that there is a single persistent tab that is used for gitv output by default. If someone really wanted two open at once there should be a way for them to achieve that, but by default you usually only want one persistent window open at a time.
Bonus flow:
Some keyboard shortcut to toggle this persistent window. If you close it, it keeps the buffer contents around so you can always go back to the diff you were looking at without having to clutter up your tabs.
Imagine, you're editing a file:
cmd+d => Opens gitv
in a new tab and diffs the file.
cmd+shift+d => Toggles the gitv
tab (so it closes it).
// Edit some other files.
cmd + shift + d => Toggles the existing diff window and focuses it.
// You can see the diff you were looking at before.
// Now edit another file.
// cmd+d => The existing gitv
window is repurposed for looking at a new diff.
This is the type of flow that most modern apps use for things like "find results" or "history views". No reason why vim shouldn't have the same flow.
Let me know what you think. This type of flow is very common in modern apps but Vim plugins never implement it - if you could factor that persistent tab/window feature out into a reusable plugin that other plugins could build on top of, it would be awesome.
Window layout logic in Vim is incredibly painful. Particularly when you factor in all the permutations of the various settings affecting these operations. This is the main driver behind keeping things simple, as they are today.
This is such a common interaction paradigm and it's where other editors/IDEs excel. As a user of Vim, it's always a pain to deal with plugins that don't "do the right thing" with their windows. Another example in gitv
is when you type :q
to quite one of the windows - the other ones aren't automatically cleaned up.
There's got to be some other plugin that helps write windowing paradigms (that also works well with multiple tabs). So many plugins end up rewriting all of the same logic.