lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

1-2-3-4-5 keys, expand active pane on the second tap

Open slavshik opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. I use hotkeys 1-5 to focus on a pane right after I launch lazygit. I find it very handy and thank you for that ❤️ But I would like to request the ability to switch and focus on a pane using a single key pressed twice.

Describe the solution you'd like Currently, I use the following hotkeys to focus on a specific pane:

  • 3 to focus on branches;
  • 4 to focus on logs;
  • 5 for stashes.

However, when working on a small monitor, I often need to expand the focused pane (Shift + =) right after the focus action, like 4 to focus on the log, press and hold Shift then + or ++ to enlarge the pane. I think it would be handy to add a second tab handler, like:

  • 5 to open stashes and 5 again to expand the pane;
  • or 4+4+4 to open logs in fullscreen right after I've launched lazygit.

Describe alternatives you've considered Add Shift + <1-5> to focus on an expanded pane.

slavshik avatar Apr 26 '23 11:04 slavshik

The suggested solution (pressing 4 on the pane under 4 again just expands it) seems reasonable and simple, at least at a first glance.

Add Shift + <1-5> to focus on an expanded pane.

How would that work when you're in a zoomed in pane and press shift+<some-other-pane>? Do you just switch to it, without changing the zoom level, or do you both switch and zoom in another level?

mark2185 avatar Apr 26 '23 12:04 mark2185

I'm against this idea because I imagine that some users have keybinding combos memorised where they need to do commit from the files panel so they press 5+c, and I don't like that if those users are coincidentally already in the files panel that it then has a different effect.

Open to getting more people's perspectives on this

jesseduffield avatar Apr 30 '23 03:04 jesseduffield

I'm not familiar with the code, so I don't know if this is possible, but you could have a double tap of 4-4 be the required input for fullscreen logs regardless of whether the window is open already. But that would require detection of a double tap in quick succession, and I don't know if that's something that is or should be supported. Then the 5+c example would not break regardless of being on that panel or not.

tzwaan avatar May 02 '23 23:05 tzwaan