Skip to content

Scroll main panel by whole pages? #1707

Description

@sdegutis

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

I'm used to using git diff, where I have to do f and b to scroll up/down whole pages.

I'd like to scroll up/down the main panel multiple pages in the same way for the same reason.

Describe the solution you'd like

I tried Ctrl-PgUp/Down and Shift-etc and they did not work. Could these be used?

Describe alternatives you've considered

Just dealing with it, but then I thought: why not post a feature request?

Additional context

Cool program everyone. Thanks for making it!

Activity

  1. jesseduffield commented on Jan 20, 2022

    @jesseduffield
    Owner

    I like the sound of ctrl+pgup/pgdown. If that's actually a thing that we can send to the terminal then I'm on board.

    f and b are already used for various keybindings so I'm hesitant to use those.

    I'll chuck a good-first-issue label on this. If anybody wants to take a stab, you can search for scrollUpMain in the codebase to see how that works. We need versions of scrollUpView and scrollDownView in pkg/gui/global_handlers.go that take the scroll amount as a parameter, rather than hardcoding to use gui.UserConfig.Gui.ScrollHeight internally. Then we can pass them the height of the view as that parameter to have us scrolling by a whole page.

  2. jesseduffield commented on Jan 20, 2022

    @jesseduffield
    Owner

    btw @sdegutis if you want to get your hands dirty with Go, this would be a good first start!

  3. sdegutis commented on Jan 20, 2022

    @sdegutis
    Author

    Sorry, to clarify, I'm requesting we use Shift-PageUp and Shift-PageDown (or Ctrl-).

  4. sdegutis commented on Jan 20, 2022

    @sdegutis
    Author

    Tbh I mainly solved this by just setting scroll amount to 10 in config instead of the default of 2 and using the mouse wheel to scroll, so this can be closed if you want.

  5. sdegutis commented on Jan 21, 2022

    @sdegutis
    Author

    By the way @jesseduffield when I looked through the src earlier, I was surprised this was written in Go. I assumed it was written using https://www.npmjs.com/package/blessed

  6. jesseduffield commented on Jan 21, 2022

    @jesseduffield
    Owner

    Happy to keep this issue open as others have asked about it (even I would like it haha).

    Yeah my choice to use Go was really just coincidence because I wanted to learn the language

  7. sdegutis commented on Jan 21, 2022

    @sdegutis
    Author

    So how do you like Go after learning it?

  8. glendsoza commented on Jan 21, 2022

    @glendsoza

    First of all Awesome tool!

    Based on my understanding of #1707 (comment) I have created a PR to try and implement this -> #1709

    I had to use Alt+f to scroll up a page and Alt+b to scroll down a page since I was not able to figure out how to use other modifiers like Shift or Ctrl

  9. jesseduffield commented on Jan 23, 2022

    @jesseduffield
    Owner

    So how do you like Go after learning it?

    @sdegutis I'm fairly critical of Go to be honest. I've had enough exposure to Rust to feel that Go is sorely lacking in features. Especially when it comes to code re-use, Go just doesn't have much (if anything) to offer due to lack of both inheritance, mixins/traits, and generics (though generics are on the way). I've done a fairly extensive writeup on my thoughts here

    @glendsoza Nice one. I've left a comment on that PR. As commented, there's another PR in flight that's going to make it easier to use shift/ctrl modifiers, and hopefully that'll let us use pgdown/pgup.

  10. sdegutis commented on Jan 23, 2022

    @sdegutis
    Author

    @jesseduffield I agree, I came to that conclusion maybe 7 years ago. I tried Rust out and I guess it's fine if you need low-level and lightning-fast and ultra-safe code, which I do 0% of the time (and apparently neither does VS Code but it works well enough). I'm going to try my hand at a quick Electron git client in TypeScript one of these days using simple-git.

  11. zhengpd commented on May 1, 2022

    @zhengpd

    I also vote for hotkeys for whole page scrolling. C-f/C-b (like manpage) and C-u/C-d (like tig) both feels right to me. It should be configurable so there should just be a default one and let users choose what they like.

  12. mattavos commented on May 8, 2025

    @mattavos

    @jesseduffield -- any update on this one? It'd be really lovely to be able to scroll by whole pages.

  13. stefanhaller commented on May 8, 2025

    @stefanhaller
    Collaborator

    As of v0.50 you can now focus the main view (by pressing 0), and then you can navigate it using all the normal navigation keys like . and , for scrolling by page, or < and > for beginning/end.

  14. jesseduffield commented on May 8, 2025

    @jesseduffield
    Owner

    Given that we do now have a way of scrolling the main view both by line and by page via focusing it, I wonder if we should update the page-up/page-down keys to actually scroll by page now. Seems like lots of people are surprised that it currently defaults to only scrolling by line.

    On the other hand, lots of lazygit users (myself included) have become accustomed to page-up/page-down only scrolling by lines

  15. stefanhaller commented on May 9, 2025

    @stefanhaller
    Collaborator

    @jesseduffield In this comment you only talk about scrolling by line vs. scrolling by page, but isn't the bigger difference which view they operate on? I'd expect pgup/pgdown to scroll the current view (by page of course, not by line), not the main view. They would then do exactly the same as , and ., in the same way as home and end do the same as < and >.

    This change makes a lot of sense to me, and I'm in favor. We still have two other ways of scrolling the main view (ctrl-d/u and J/K; they are both listed in the keybinding cheat sheets, but are otherwise not very discoverable).

    But I'm probably not qualified to judge, because I rarely use the keyboard to scroll the main view; I use two fingers on the trackpad for that.

  16. otytlandsvik commented on May 9, 2025

    @otytlandsvik

    As a vim user, I'm accustomed to ctrl+u and ctrl+d scrolling by half pages, and that is what I expected in the lazygit diff view (instead, it scrolls one line, just like pg up/dn). I'm very much in favor of making these scroll by page in the diff view.

    When I'm staging files for a commit, I'd like to quickly move from file to file, while being able to scroll quickly in the diff without having to switch focus back and forth between the panes.

    Ideally, scrolling by line should also be available somehow in this view. One suggestion would be to use ctrl+e and ctrl+y to scroll by line, just like in vim, however, I see that ctrl+e is already in use. ctrl+j and ctrl+k could also be agreeable, and seems to be available.

  17. hacker-DOM commented on May 9, 2025

    @hacker-DOM

    We could also scroll alternative views by alt+down/up or ctrl+down/up

  18. pstefa1707 commented on Jun 3, 2025

    @pstefa1707

    I think a modifier + any-navigation keys applying to the current view would be good.

    ctrl + , or ctrl + . applying to current view would be great. I also think we should have an alternative for line scrolling on the current view, page-up/down should really do what they say on the box imo.

    ... I should really offer a PR rather than my opinion

  19. DanOpcode commented on Jun 30, 2025

    @DanOpcode

    As of v0.50 you can now focus the main view (by pressing 0), and then you can navigate it using all the normal navigation keys like . and , for scrolling by page, or < and > for beginning/end.

    Thanks, that's perfect!

  20. goyalyashpal commented on Jul 14, 2025

    @goyalyashpal

    i think that the current keybind of lazygit (0.52) is fine:

    • ,.: single page (comma, dot)
    • <>: top/bottom (less/greater than;S-, / S-.)
    • kj: single line
    • UP/DN: single line (arrows)
    • PGUP/PGDN: main pane single line (page-up / page-down)
    • C-u/d: main pane single line (i don't use) (ctrl-u / ctrl-d)

    i am using workman layout, and not vim.
    so, forcing legacy vim needlessly in my throat would very well be an unpleasant change.

  21. KJ7LNW commented on Aug 3, 2025

    @KJ7LNW

    for now is there a workaround that we can do in the configuration? I would be happy if simply pageup and pagedown in their current implementation have a configurable number of lines that will scroll . is that configurable?

    or maybe there is a a way to bind a new key to behave like ,. in my (eg) "unstaged changes" frame?

  22. sysoleg commented on Aug 10, 2025

    @sysoleg

    is that configurable?

    @KJ7LNW

    gui:
        scrollHeight: 20
    
  23. KJ7LNW commented on Aug 10, 2025

    @KJ7LNW

    is that configurable?

    @KJ7LNW

    gui:
        scrollHeight: 20
    

    awesome, now it just needs to be configurable as a % of viewport height!

  24. rpgdev commented on Aug 20, 2026

    @rpgdev

    I wonder if we should update the page-up/page-down keys to actually scroll by page now. Seems like lots of people are surprised that it currently defaults to only scrolling by line.

    I think that this is how it should be implemented. Ctrl+pgup/down is unnecessary and awkward as well. It confounded me to see that PgUp/PgDn simply scroll and,/. scroll pages. There seem to be a million ways to scroll the screen, not sure why the PgUp/PgDn buttons were chosen to also do this. Users will definitely not expect this, except, ofc, longtime users who are already used to the current misnomer :) Luckily, I was able to change it easily via the config.

  25. HaleTom commented on Oct 24, 2026

    @HaleTom

    Supporting this — I checked the source and the pane size is already known at runtime (ViewTrait.PageDelta() = InnerHeight()-1 in pkg/gui/context/view_trait.go). The gap is only that scrollUpMain/scrollDownMain hardcode Gui.ScrollHeight (default 2, user_config.go) with no bindable page-scroll-main action. So this doesn't need config-side size detection, just the parameterized scroll actions described above, bound to ctrl+pgup/pgdn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions