4

Sometimes in a long commit log, it's really painful to navigate the all-expanded diffs.

(You get expanded-diffs when hitting enter from the magit-blame-mode for example)

Is there a way to collapse these diffs?

eugene
  • 39,839
  • 68
  • 255
  • 489

1 Answers1

9

In any buffer you can type C-hm to see the major and minor mode descriptions, which almost always includes the key bindings defined by each mode (and if it doesn't, you can type C-hb and then search for the mode you're interested in).

Major mode magit-diff-mode includes the following bindings:

M-1     magit-show-level-1-all
M-2     magit-show-level-2-all
M-3     magit-show-level-3-all
M-4     magit-show-level-4-all
M-H     magit-show-only-files-all
M-S     magit-show-level-4-all
M-g     magit-goto-diffstats
M-h     magit-show-only-files
M-n     magit-goto-next-sibling-section
M-p     magit-goto-previous-sibling-section
M-s     magit-show-level-4
phils
  • 71,335
  • 11
  • 153
  • 198
  • Is that a question (about magit-status) ? I can't tell. – phils Feb 11 '14 at 03:25
  • No it was just a rent. I had hard time figuring out magit-show-only-files-all then again figuring out it was meant to be used in magit-diff-mode not the magit-status. – eugene Feb 11 '14 at 04:45
  • meaning, I knew `C-h m`, but sometimes it's hard for me to catch what I just need :( .. for example. yes I can't see anywehere magit-show-only-files-all is meant for magit-diff-mode anywhere. How can you tell? – eugene Feb 11 '14 at 05:47
  • 1
    All the bindings listed by `C-h m` should do something in that buffer. Magit's a slightly odd case in having many modes all ultimately derived from `magit-mode`, with the latter defining the majority of those bindings (which are then inherited); so it's certainly possible that some of the bindings are not as relevant to particular modes. If you feel there are non-functional bindings in some Magit modes, you can log a bug report at github. – phils Feb 11 '14 at 10:47
  • Thanks, M-h and M-H is OK for me. – netawater Jan 22 '16 at 08:42