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

杀马特。学长 韩版系。学妹 提交于 2019-12-03 09:41:54

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).

As you can see in the screenshot below, there is an option called Collapse All and a shortcut key next to it.

Now this shortcut key will not work for you !

Unless ofcourse, you set it up using Tools > Options > Keyboard. The command name is CollapseInSolutionExplorerAction. Search using this command name and assign a shortcut key of your choice.

That's it and you are ready to use your shortcut key !

Source

Visual Studio 2012 / ReSharper 8.0.1:

The command is 'ProjectAndSolutionContextMenus.Project.ReSharper_CollapseInSolutionExplorer'.

I suggest you to try CodeMaid extension for Visual Studio. It provides a command "Collapse All Projects Recursively" that has customizable shortcut (by default, it is Ctrl+M,-). It has some other nice abilities, like switching between .cpp and its .h files, joining lines, etc.

I have searched on the net a way to do this when I have first install VS2012 ..

I have just found the solution, so I share it :)

you can do this by adding your visual studio version to an existing Extension ...

  • Download the extension for VS 10
  • Change the extension from vsix to zip
  • extract it and open the file extension.vsixmanifest
  • Find this xml section : SupportedProducts Add this :

    <VisualStudio Version="11.0">
    <Edition>Ultimate</Edition>
    <Edition>Premium</Edition>
    <Edition>Pro</Edition>
    </VisualStudio>
    

you can also try version 12 for visual studio 2013 ...

  • zip it, and change the extension from zip to vsix.

  • Now you can Install it.

  • after install it, Goto Tools -> Customise and click on the keyboard button.

  • Search "CrossProjectMultiProject.CollapseProjects" and assing the shortcut you like.

Have a nice codding. Please +1 if this help you

ps. sorry for my bad English, im French ;-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!