Attach a keyboard shortcut to 'Collapse All' items in solution explorer with Visual Studio 2012

Samuel picture Samuel · Sep 24, 2012 · Viewed 9.2k times · Source

Like I said in the title of this question, is it possible to attach a keyboard shortcut to collapse all items in the solution explorer with Visual Studio 2012?

In previous version; 2010, I was able to create a macro to enable this feature but in Visual Studio 2012, there is no more support for macros.

I'm able to right click onto item in the solution explorer and choose 'Collapse All' but I prefer to just typed 'Ctrl+Shift+C' to do the same job.

Answer

Mark Seemann picture Mark Seemann · May 9, 2013

FWIW, this is the best I've been able to come up with so far.

Alternative 1

  1. Press Ctrl+¨ to put focus in the search box above the Solution Explorer.
  2. Press Shift+Tab to move focus to the toolbar.
  3. Use the left arrow to move focus to the left, until you hit the Collapse All button (four times. YMMV).

Alternative 2

  1. Press Ctrl+Alt+l (or whatever your personal shortcut is) to focus the Solution Explorer.
  2. Press Shift+Alt to focus the Solution Explorer toolbar. This puts the focus on the Home button on the toolbar.
  3. Use the right arrow to move focus to the right, until you hit the Collapse All button (three times).
  4. Press Enter.

Alternative 3

  1. Press Ctrl+Alt+l (or whatever your personal shortcut is) to focus the Solution Explorer.
  2. Press and hold the left arrow until you've reached the top node (the Solution node).
  3. Press the up arrow to put focus in the search box above the Solution Explorer.
  4. Press Shift+Tab to move focus to the toolbar.
  5. Use the left arrow to move focus to the left, until you hit the Collapse All button (two times. YMMV).