jesseduffield / jesseduffield/lazygit
PgUp/PgDn should page the focused view
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
> **Relation to #1707:** that issue asks for a *new* binding (`ctrl`/`shift`/`alt` + pgup) to scroll the *main panel* by pages. This one is narrower and different: leave the main panel alone, and make the *existing, unmodified* PgUp/PgDn keys page the *focused* view, so they match `,`/`.`. It is a consistency fix to a key that already exists, not a new feature. The idea was raised inside #1707 by @jesseduffield ([comment](https://github.com/jesseduffield/lazygit/issues/1707#issuecomment-2864612011)) and @stefanhaller ([comment](https://github.com/jesseduffield/lazygit/issues/1707#issuecomment-2865372044)) in May 2025 but was never split out, so it has no issue of its own. Happy to have this folded back into #1707 if you'd rather keep it in one place.
### Is your feature request related to a problem? Please describe.
In v0.64.0, plain PgUp/PgDn are bound to `scrollUpMain`/`scrollDownMain`:
```yaml
scrollUpMain:
scrollDownMain:
```
So they move the main panel by `gui.scrollHeight` 2 lines by default. That surprises new users since the keys not only behave in ways that are unexpected, but it's the only view where PgUp/PgDn don't follow lazygit's own pattern.
| Key | Mirrors | Acts on |
|---|---|---|
| ↑ / ↓ | `k` / `j` | focused view |
| Home / End | `<` / `>` | focused view |
| PgUp / PgDn | — | **main panel, 2 lines** |
``/`` are already going to the top and bottom. ``/`` are already `prevItem`/`nextItem`. Every neighbour of PgUp/PgDn is doing the equivalent action on the focused view. PgUp/PgDn is the exception.
### Describe the solution you'd like
Make PgUp/PgDn the alt-bindings for `prevPage`/`nextPage`, exactly as Home/End are for `gotoTop`/`gotoBottom` and drop ``/`` from `scrollUpMain`/`scrollDownMain`.
Since v0.50 the main view is focusable with 0, so this loses no ability: focus the main view and PgUp/PgDn page the diff, which is what most people pressing those keys wanted anyway.
**On backwards compatibility** — this is the objection @jesseduffield raised in #1707, and I think it's understandable, it will be inconvenient for users used to the old behavior. I still think it should be implemented for the following:
- Main-panel line-scrolling keeps two bindings, both untouched: `K`/`J` and ctrl+u/ctrl+d.
- Anyone who prefers the old behaviour could restore it via config.
- Today the asymmetry runs the other. To get paging on PgUp/PgDn you must first discover the key is bound to an entirely different action in just one of the panels.
Still, there will definitely be a cost for existing users, no two ways about it. This will require an executive decision from the project, I can only make the case for what I want to see happen :)
### Describe alternatives you've considered
**Swap them in config.** Works today, and is what I'm running:
```yaml
keybinding:
universal:
prevPage:
nextPage:
scrollUpMain: ','
scrollDownMain: '.'
```
That's fine for me, but it doesn't address the default, which is the part that costs new users — and it only works because I already knew the key was bound to something else. That's the discovery step this issue is about.
### Additional context
- lazygit `v0.64.0`, git `2.55.0`, Linux.
- #1709 (open since 2022) implements the #1707 approach with `alt+f`/`alt+b`. It predates both the focusable main view and the modifier-key support that landed since, so I don't think it overlaps with this.
Contributor guide
Research direction
Start by locating the keybinding definitions for prevPage, nextPage, scrollUpMain, and scrollDownMain, then inspect how focused views receive these actions. Change the default PgUp/PgDn bindings as described while preserving the existing main-panel alternatives, and verify that paging follows the focused view and config overrides still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100