2

I've implemented the suggestions in Scott Hanselman's blog post Simplify your Visual Studio 2010 Toolbar and Free Your Mind. Very cool.

Where can I find/execute the command "Close All But Pinned" that is part of Visual Studio Productivity Power Tools.

Tim Murphy
  • 4,892
  • 4
  • 40
  • 48

2 Answers2

2

You can assign a shortcut in Tools -> Options -> Environment -> Keyboard. Search for Window.CloseAllButPinned in the Show commands containing: textbox and assign your own key combination.

Similarly, you can execute that command in the "Go To Find Combo" small box, i.e. press Ctrl+/ then type ">Window.CloseAllButPinned", press Enter.

Denis Ivin
  • 5,594
  • 1
  • 26
  • 25
  • Excellent suggestion and implemented. However I would like toolbar option for those brain dead days :-) – Tim Murphy Mar 13 '11 at 00:25
  • I don't think it allows adding toolbars.. couldn't you simply add commands from a toolbar to the menu bar? There is also an option to begin a new group in the menubar so you can simulate a toolbar. – Denis Ivin Mar 13 '11 at 00:44
1

It is a two step process:

Create a Macro with the following

Public Module myToolbar
    Sub CloseAllButPinned()
        DTE.ExecuteCommand("Window.CloseAllButPinned")
    End Sub
End Module

Right click on your Toolbar, choose Customize, Add Command, Category Macro, choose MyMacros.myToolbar,CloseAllButPinned

Then click ModifySelection and give it an easy to remember name

Noah
  • 15,080
  • 13
  • 104
  • 148
  • Thank you. how about assigning it to the context menu that comes up from right-clicking on the tab of an open document? I saw elsewhere that the menu to modify is `Other Context Menus | Easy MDI Tool Window`. Not sure if the fact that I have Resharper installed affects the context menu choice. Cheers! – Carl G Aug 01 '12 at 14:32
  • In VS2013, executing `dte.ExecuteCommand("Window.CloseAllButPinned");` shows Command is not valid. – sjlewis Aug 18 '16 at 09:23
  • It seems that Macro recording is not supported in visual studio 2012 http://stackoverflow.com/questions/12062515/can-i-record-play-macros-in-visual-studio-2012-2013-2015 – Tal Segal Feb 01 '17 at 13:46