5

I know I can press Enter to show the commit diff, but

  1. that's too slow for browsing
  2. it steals focus from the log window
  3. there's a lot of visual change in the frame with the diff window opening and closing
  4. It's a lot of keystrokes to move from one commit's diff to the next

Can I program magit to a gitk kind of style that always shows the commit msg, changed files and diff of the currently selected commit?

2 Answers 2

1

Just navigate the log window with n and p. The diff window will auto-popup and auto-update. There's currently a bug that prevents scrolling by holding n. It's possible to use the previous Magit version to avoid this bug.

3
  • Thanks, that does it for me! Note for spacemacs users: n in C-n and p is C-p.
    – mbertheau
    Jul 16, 2015 at 2:21
  • The command is magit-go-forward/magit-go-backward. It's mapped to C-j and C-k in some versions of specemacs.
    – sitaktif
    Jun 20, 2017 at 9:34
  • not in "some" versions of spacemacs, but the ones using evil mode, cause j/k are vim key-bindings
    – denis631
    Oct 31, 2019 at 0:29
1

When moving inside the log buffer using n and p, then the revision buffer is automatically updates to show the commit at point. This can be controlled using the option magit-diff-auto-show.

Until a little while ago that did not work well when holding down one of these keys, because that caused the revision buffer to be updated for each commit moved over in the log buffer. I just pushed a kludge for that, which works by delaying updating the revision buffer. You might want to customize the new option magit-diff-auto-show-delay in order to fine-tune the delay.

Alternatively you can configure magit-diff-auto-show to not automatically update the revision buffer. If you do so you can still display the commit at point in the revision buffer by pressing either RET or SPC. The former makes the revision buffer the current buffer, the latter does not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.