Visual Studio: assign a key to maximize edit window - visual-studio

How can I assign a hotkey to maximize the edit window?
Basically I want the equivalent of:
switch to edit window + minimize all side panes
or at least just minimize all side panes (and leaving the menu and toolbar as is)
NOTE: this is different than full screen, I do not want to change the size of the VS window itself.
I need this on Visual Studio 2017 / 2019.

Short of some sort of macro I thing the best way is probably like this:-
Setup the windows in VS as you want them to look
Save that as a layout.
Assign a hotkey to the Switch to layout command.

Hot Windows extension provides shortcuts to hide and show all tool windows (e.g. Shift+Alt+Ins).

Related

how to hide all windows except editor window in Visual Studio 2013?

In Eclipse when you click twice on the tab of the editors Eclipse hide all other windows except the one you write code in and when you do that again(clicking the tab of the document all windows comeback again).
Is there a similar feature in Visual Studio 2013?
Update: I found Auto Hide in Window Menu, but I don't want auto hide, I want to click something to hide windows and click again to show them.
As a programmer i love shortcut keys which is very helpful for productive work. I've search question as you mentioned. But i did not get proper answer. then i've searched solution for me which might helpful to you.
Step 1: Go to visual studio
Step 2: From tool menu open Options menu
Step 3: Go Environment -> Keyboard
Step 4: Select item Window.AutoHideAll from list
Step 5: Set short cut in "Press shortcut keys textbox". I've set Ctrl+Alt+] then click on Assign & then ok.
Step 6: Final step. Use above shortcut to hide all window other than editor window.
View | Full Screen
(In my key bindings: shift+ctrl+enter.)
However, double clicking on an editor tab also works, this is provided by one of the extensions I use, but I'm not sure which.)
Richards answer does work, but has the side effect of maximizing the whole of Visual Studio as well. Sometimes (e.g. when comparing editor text to some other text), I would like Visual Studio to only take half the screen. A solution I found in Visual Studio 2019 was:
Window | Save Window Layout (call it something like Normal layout)
Unpin all the other panes you don't want to see, ToolBox, Solution Explorer, Build Results etc. Typically Left, Right and Bottom
Window | Save Window Layout, call it say maximized Editor.
Window | Apply Window Layout, you can choose Normal or Maximized editor
Visual Studio assigns these shortcut keys automatically of Ctrl+Alt+1 and Ctrl+Alt+2 to the first two Apply Window Layout choices

How to assign a shortcut to the mouse navigation button in Visual Studio?

I'm using VS2010, VS2012 & VS2013.
I want to assign a keyboard shortcut to the back/next navigation buttons to be set to View.NavigateBackward and View.NavigateForward.
In the toold->options->keyboard I can't bind a command shortcut to a mouse-previous nor mouse-next button. Maybe because they are not keyboard-shortcuts...
Is there any way to assign a shortcut to those? (or to any mouse+keyboard shortcuts)
I know they are set by default to do almost the same thing but still I find the Ctrl+- and Ctrl++ (NavigateBackward and View.NavigateForward respectively) to be much more predictive and so much more usefull.
I saw this post (which also writes how the mouse-previous and mouse-next button work in VS by default):
How do Visual Studio 2012's navigation buttons behave?
and also the link there on the answer is broken.
This is not possible without a VS extension, which can be found here: Link. Sometimes though, the navigation backwards does not work with the mouse, but works when pressing the button in the interface.

Is there an easy way to pin a DataTip in Visual Studio 2010

Sometimes pinning a DataTip in Visual Studio 2010 is not very easy using the mouse, e.g:
If the DataTip is very long (as shown above), it can be quite tricky to move the mouse cursor from the variable to the "pin" icon. Sometimes the DataTip will disappear as soon as the mouse is moved outside of the DataTip area.
Is there an easy way to pin DataTips, e.g. a keyboard shortcut?
You can use the context menu. Just click on the variable to pin and than choose "Pin to source".
(In addition to Werolik's answer)
It seems, that by default no keyboard shortcut is defined to pin a DataTip. But it is possible to define a custom shortcut:
go to Tools --> Customize... --> Keyboard...
search for commands containing PinToSource
set a custom shortcut key combination

Multiple windows in Visual Studio

I've just come to Visual Studio 2008 from a UNIX / Java background.
In Visual Studio, how can I have multiple overlapping editor windows? In Eclipse, I can open a new Window, add an editor to each of them, then Alt-Tab between them, overlap them, select them in the Taskbar, etc. Similarly, I'd like to put 'Output' in it's own 'first class' window so I can easily Alt-Tab between that and an editor when on a laptop.
Studio tools lets me 'tear off' and editor window, but the 'torn off' window doesn't respect Alt-Tab rules, and always hides the main Visual Studio pane.
Update: By way of example, In 'Word' I can have two documents open. I can Alt-Tab between them. I can Alt-Tab between either document, or Alt-Tab from either one to Outlook if I wish. I can overlap the documents, or place them side-by-side. I can place one document on one monitor, and one document on the other. I can have have Outlook open on one screen, overlapping one of the Word documents, while I edit the other. This is the kind of thing I would like to do with my source files!
You can change the window layout in the Tools menu under Options. The very first item is Environment\General. You can choose Multiple Documents (versus Tabbed Documents). That may give you the "look" you are describing.
However, I don't think it is possible to use alt+tab to change windows since those windows still belong to the single instance of VS2008. You can change windows with ctrl+F6. In addition, a nice trick when using Tabbed Documents is to press ctrl+alt+down arrow. That brings up a list of all open editor windows.
Alt+Tab is for switching between applications on Windows.
To switch between windows within Visual Studio use Ctrl+Tab.
This should work on any mutli-windowed application.
You can click on the tab of the window and drag outside making it a standalone window.
If you are a vim user, and install VsVim, you have an effective work around for dealing the quirky behaviour Visual studio has for moving between file editing windows.
You can easily make vertical and horizontal split windows within the "main" file editing window, just as you would in vim, using the regular vim keys. e.g. with any of the regular vim commands :vs, <C-w>s, <C-w>v, ...
If you tear off a second editing window (e.g. with the mouse) and put it on a separate monitor, you can use Vim's global marks, or <C-w>w (and similar commands for navigating between panes in vim) to jump between file editing windows across different monitors/screens with just a few keys.

How to control VS window positions and state from a macro

I want to set up some hotkeys in Visual Studio to control the window layout.
For example, F10 would collapse all windows (such as the command from the windows main menu called - Auto Hide All) and then F11 which would dock and position certain windows of my choice at certain positions. This would be so I can jump to specific layouts quickly.
So how to control window layout from visual studio macros?
Probably not optimized but couldn't you consider using vssettings and Import/Export Settings to achieve your goal? (I know this isn't exactly the answer to your question...)
****Update****
You can check out my blog post which provides the ability to list and switch window layouts in Vs2008 and Vs2010: http://www.brianschmitt.com/2010/09/save-and-change-tool-layout-in-visual.html
****Old Answer Below****
If you are looking for a repeatable setup, then a Macro may be your best option. AutoHideAll may already be bound to CTRL+Shift+~ - I cannot remember if that is the default. If not, you can bind it in your Tools-->Options-->Keyboard dialog. In there you can also bind the Macro below to your F11.
Here is a Macro that will accomplish the layout for you:
Public Sub SetupMyPersonalLayout()
DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Visible = True
DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).AutoHides = False
DTE.Windows.Item(Constants.vsWindowKindTaskList).Visible = True
DTE.Windows.Item(Constants.vsWindowKindTaskList).AutoHides = False
End Sub
This will show the window and then "pin" it.
Another option that comes to mind is to take advantage of the different views that Visual Studio offers (Standard, Full Screen, Debug, and some others).
Lastly, if you are on 2005 or earlier (or if you want to update the code) there is an add-in that will do it for you: http://www.codeplex.com/VSWindowManager

Resources