NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
4.02k stars 236 forks source link

Use ; and , to scroll commit view inside log view #1190

Closed saep closed 7 months ago

saep commented 8 months ago

When viewing the commit log, pressing ; or , can be used to open the commit view without focusing it. If you press ; again, it will scroll down the commit view. With , you can scroll up. Because the commit view window isn't focused, you can quickly focus the next commit with j or the previous with k.

This reduces the amount of key presses significantly when reviewing changes of multiple commits because you don't have to switch windows twice for every commit you want to look at.

Since f and t are bound differently to normal vim usage, ; and , are also basically free to use. On the US layout (and others), you only need the right hand to review the changes and can use the left hand to drink coffee or tee. ;-)

These bindings implement the same functionality as magit-diff-show-or-scroll-down and magit-diff-show-or-scroll-up.

This workflow is something that I've grown very accustomed to and one of the reasons I'm still using (Doom) Emacs at work. I also think, that it is useful for other people, so I've opened this PR. This is literally my whole magit-configuration:

(map!
 :map magit-log-mode-map
 :g ";" 'magit-diff-show-or-scroll-down
 :g "," 'magit-diff-show-or-scroll-up
 )
CKolkey commented 8 months ago

Cool - I'm a bit backlogged right now with stuff, but we'll get this merged in good time. Thanks for the PR

CKolkey commented 7 months ago

Alright. This is sweet. Nice work :)

CKolkey commented 7 months ago

Just a heads up, on the nightly branch I made these keys user configurable