14

Pressing TAB on a single unstaged file shows or hides details pertaining to that file.

How do I show & hide (toggle) details of all unstaged files at once?

I did come across outline-hide-sublevels via M-x. But I would like to know a key combination to do this in a toggle fashion.

I also typed ? to check the keybinding shortcuts for the magit-status area but could not find an answer.

16

I think you want M-TAB magit-section-cycle-diffs

https://magit.vc/manual/magit.html#Section-visibility

  • Fantastic, I did look through the docs but must have missed this. Thanks very much – orion Sep 6 '16 at 1:31
  • @orion Happy to hear that's what you were looking for. If this fully answers your question you can click the checkmark to the left of this answer to "accept" it so others know the question is complete. – Jack Sep 6 '16 at 4:30
  • 4
    Every operating system or window manager I have used in the last 15 years has M-TAB bound to window switching... – Fred Schoen Apr 5 '18 at 10:10
  • 2
    Actually what I was looking for was M-2 or M-4 from anywhere in the magit buffer to expand and collapse all, which is documented in the link Jack provided – orion Feb 6 at 3:57
6

Another method (if you do not want to change key bindings for the M-TAB solution) is to position your cursor on the line with the section heading, e.g. "Unstaged changes", and press 2 to collapse all changes in that section, or 4 to expand them.

It also works for collapsing/expanding changes per subsection/file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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