Lazygit: FR: commands to go to the top and bottom of panels and to scroll up and down panels faster

Created on 22 Feb 2020  路  8Comments  路  Source: jesseduffield/lazygit

Is your feature request related to a problem? Please describe.

Unless I have missed something, the only way to navigate up and down the commits history (in panel 4) is one line at a time.

While this is great for recent commits, it is a little tedious to go further in the history of a repo.

Describe the solution you'd like

It would be great to have commands such as firstItem and lastItem to jump easily to the latest and earliest commits. (These top and bottom navigation actions (equivalent to gg and G in a lot of vim-keyboard-based software) would be great in all the panels actually. Including in the Patch right-side panel).

Additionally, it would be nice to have commands to scroll down commits one panel-height at a time or 10 lines at a time. That way, j and k (or whatever people use for nextItem and prevItem) would allow for small step scrolling and the other commands for bigger jumps/faster navigation.


The same commands could be used in panel 2. Though there are usually less lines there than in the commits panel, there could be quite a few files too.

Thank you!! (and thanks for the great project :slightly_smiling_face: )

enhancement

Most helpful comment

Got a PR up for this now! https://github.com/jesseduffield/lazygit/pull/764

This functionality is now enabled for all list panels. I want to add it to the main panel as well but that requires some groundwork: there are many different contexts you can be focused in the main view for and we want to do some combination of supporting the keybindings in those views and also allowing a generic 'focus main' option where you can just view the main panel the same way you would view a list panel, with searching/paging available.

All 8 comments

I would love to do this feature, but I'm stuck thinking about what keybindings to use. Currently shift+j and shift+k are used for scrolling the main panel while a side panel is focused, and in the commits panel ctrl+j and ctrl+k are for shifting a commit up or down.

I'd ideally want to repurpose ctrl+j and ctrl+k for jumping page by page but I think they're pretty intuitive in the context of moving commits. Maybe I could have some other keybinding to put us in 'move commit' mode where then the arrow keys move the commit, and you hit escape to leave move mode.

That still would only allow us to jump pages rather than go straight to the top or bottom of the panel. You mention 'gg' and 'G'. We aren't using 'G' (that I can see) but we are using 'g' and we don't have support for multiple-key keybindings. What are your thoughts?

Sorry for the delayed reply. Extremely busy times for me right now.

I have custom keybindings in all my apps. So I would instantly re-bind whatever keybindings you would set :smile:

So I am not the best person to advise on what keys to use!

I guess everyone can re-bind keys to whatever they like, so having the functionality is probably more important than having the "perfect" keybindings (that's such a personal preference :slightly_smiling_face: ).

+1 for this feature!

I agree with @prosoitos, having the option to map this functionality to something using the config would be awesome already.

Throwing in another suggestion: we could use the "home" and "end shortcuts (on a Mac it's fn+left and fn+right respectively)

I'm gonna make a start on this soon. My dilemma remains around keybindings.
We need six ways to go up and down:
1) per line (currently up/down, j/k)
2) per panel (currently left/right, h/l)
3) per page inside panel (no keybindings yet)
4) to top and bottom of panel (no keybindings yet)
5) up and down main panel (currently page up/page down, shift+J/shift+K)
6) moving a commit up or down (currently ctrl+j/ctrl+k)

So we need to find some way to end up with sensible defaults here, without causing too much disruption to people who have gotten used to the existing keybindings. Given how rarely commits are moved up and down I'm happy to move that functionality into a menu. I'm thinking of even maybe having a new kind of menu where it appears with X options and next to each option is a key you can press to activate it, meaning if you know the keybinding ahead of time you can ignore the menu. That allows us to chain keys together which we pretty much need to start doing now due to our ever dwindling keybinding realestate.

Interested in people's thoughts :)

Got a PR up for this now! https://github.com/jesseduffield/lazygit/pull/764

This functionality is now enabled for all list panels. I want to add it to the main panel as well but that requires some groundwork: there are many different contexts you can be focused in the main view for and we want to do some combination of supporting the keybindings in those views and also allowing a generic 'focus main' option where you can just view the main panel the same way you would view a list panel, with searching/paging available.

closing, but let me know if anybody wants to see changes!

Thank you!!! :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

voigtan picture voigtan  路  4Comments

kristijanhusak picture kristijanhusak  路  6Comments

tupaschoal picture tupaschoal  路  6Comments

5minpause picture 5minpause  路  6Comments

letarg0 picture letarg0  路  4Comments