In visual studio 2010 what is/how to set the hotkey to pin and unpin an active pane?
Asked Answered
C

3

26

I often run tests and need the test-result pane to be pinned. In other time, I mostly work with writting codes and compile - I prefer to have the output pane (which shared the same space with test-result pane) automatically viewed while compiling and collapsed when done (i.e. unpinned).

I need an hotkey to quickly switch the pane to pinned/unpinned state. How can I do that?

Clamant answered 30/9, 2010 at 4:6 Comment(0)
K
33

Check out this post on Visual Studio 2010 - Keyboard Shortcuts

  1. Select the Output windows with CTRL+ALT+O
  2. Pin the Output with ALT+W+K
  3. Auto hide the Output with ALT+W+A
Kendrick answered 30/9, 2010 at 4:25 Comment(4)
I like the simplicity, but it's not really a hotkey for the command (you're accessing the command from the menu).Crambo
In VS 2012, Alt-W, k is Dock, which is related but not quite the same as pin. There's Alt-W, p, for Pin Tab, which is not working for me at the moment. And the tooltip for the pushpin icon is "Auto-hide". @Crambo I consider it a hotkey as long as I don't need the mouse. You could customize it to a single chord if you like, and bypass the menu.Borras
@Jay it's not working because there are two menu commands catching the 'p' letter: Split and Pin Tab. Alt-W, p, p, Enter should work - but I guess you can hardly call it a "shortcut" ;)Kelso
Another option is to use alt+- to access the menu of the current active window (Visual studio 2015)Cartage
K
8

In VS 2017 you can assign your own hotkey to the command Window.PinTab, which both pins and unpins a tab.

Options > Keyboard Shortcuts

Kinser answered 7/6, 2019 at 7:35 Comment(1)
..and in case you never use print you can assign pin/unpin to CTRL+PViole
K
6

You can locate the commands in the options dialog (Tools -> Options -> Environment -> Keyboard), and assign whatever keyboard shortcut you want for this. However, in your case it's two commands: one for "pinning" and another for "unpinning". Another option would be to write a macro that combines the commands:

Sub DockOutputWindow()
    DTE.ExecuteCommand("View.Output")
    DTE.ExecuteCommand("Window.Dock")
End Sub

Sub AutoHideOutputWindow()
    DTE.ExecuteCommand("View.Output")
    DTE.ExecuteCommand("Window.AutoHide")
End Sub

Then you can use the keyboard options to assign shortcut keys to these macros.

Of course you can do this in an even more advanced way. Say you have the command SetCodingMode that will both dock the output windows and hide the test-result window and SetTestMode that does the opposite.

Kyanite answered 30/9, 2010 at 4:39 Comment(1)
It's Tools -> Options -> Environment -> KeyboardSympetalous

© 2022 - 2024 — McMap. All rights reserved.