128

Is there a way to save (and later revert to) a given window layout in VS2010/VS2012/2013?

lance
  • 16,092
  • 19
  • 77
  • 136
  • 3
    With all due respect to user Cody Gray and his answer, I suggest switching the answer to user oocx below, who found what you were looking for, and indeed, what I am looking for. What you want is now possible via that addon and I suggest switching the answer so that other users who stumble upon this topic will know that the problem is now solved. – Axonn May 03 '11 at 13:20
  • 2
    VS2012: `Alt-T, I` accelerates you to the "Import and Export Settings" menu option. – lance Oct 12 '12 at 13:16
  • 1
    @lance: Or define a shortcut in Tools->Options->Environment->Keyboard for the `Tools.ImportandExportSettings` command. – Otiel Jan 30 '13 at 17:49
  • The Delphi IDE has had this facility built in as a task bar combo box for as long as I remember. I have found Visual Studio's lack of an equivalent feature astounding and incredibly annoying. Delphi also has the option to automatically swap layouts when debugging. – Gerry Coll May 01 '14 at 21:37
  • Check Thomas answer below if you're looking for VS 2015+ solution for this. – JohnTortugo Mar 27 '18 at 20:27

5 Answers5

91

Yes, you can use the "Import and Export Settings Wizard" (found in the Tools menu) to export only the settings that relate to your current window layout to a file. Uncheck everything but "General Settings" > "Window Layouts", and save the file somewhere you'll be able to find it later.

Then, you can use the "Import and Export Settings Wizard" again to import that settings file, restoring all of your tool windows to their previous layout. (Note that the wizard also allows you to limit what you import from a particular settings file the same way you can limit what you export.)

I use this on my laptop, where switching back and forth between single and multiple monitor setups turns window management into a real pain. I just maintain settings files that describe each of the layouts I use most frequently, and import the one that best fits my current working environment when I need it.

Zain Naboulsi has blogged about the process here, complete with illustrative screenshots.


Update: Praveen Sethuraman, from the VS team, points out that Visual Studio 2015 finally has the ability to save custom layouts as a built-in, first-class feature. However, I have not had a chance to test the implementation yet.

Community
  • 1
  • 1
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • This doesn't save opened tabs for me on Visual Studio 2012 :( – Nam G VU Oct 15 '13 at 08:46
  • 6
    This seems so hackish to me - especially considering I think both Eclipse and Netbeans just have layouts you can save/access from a menu. – Wayne Werner Dec 05 '13 at 13:06
  • Meanwhile, Visual Studio 2015 has a layout that can be saved from a menu, see [the answer below](http://stackoverflow.com/a/25021115/5427663). – TheOperator Dec 06 '15 at 20:02
  • No, it doesn't work for saved tabs. Those are stored in a private file along with your project, @nam. They will be restored automatically when you reopen a project you have been working on. – Cody Gray - on strike Jun 19 '16 at 14:41
61

There's a nice Visual Studio plugin that lets you save and load custom window layouts: http://perspectives.codeplex.com (you can also find it in the VS gallery).

I use it because I often have to switch between a three screens layout(when my laptop is docked) and a single screen layout (laptop display only).

It's also useful because VS randomly forgets my custom layout after debugging.

WEFX
  • 8,298
  • 8
  • 66
  • 102
oocx
  • 780
  • 5
  • 8
  • 1
    +1, though this tool is buggy, it does apply the setting very well. – Vaccano Feb 07 '12 at 17:01
  • This plugin doesn't save opened tabs for me on Visual Studio 2012 :( – Nam G VU Oct 15 '13 at 08:39
  • 2
    tried perspectives - nice idea but it's buggy as hell. ended up uninstalling. – GarethD Nov 21 '13 at 09:59
  • Same as GarethD. Had to uninstall as kept giving me endless null reference exception message boxes and crashed VS multiple times. – Chris Pickford Dec 12 '13 at 09:50
  • 2
    Perspectives doesn't seem to have support for VS 2013, and the reviews aren't as good as Layouts O Rama (even if the name is better). I'd like to try it, if they come up with a newer version. – Lucas Fowler Jan 07 '14 at 19:30
51

Layouts-O-Rama is my take on the problem. To be found in the vs gallery here:

http://visualstudiogallery.msdn.microsoft.com/35966ad9-430f-4ad7-9186-4394b784e36c

mklein
  • 1,787
  • 1
  • 15
  • 18
  • 4
    I think you should mentioned you developed it to be totally honest – VdesmedT May 14 '13 at 13:18
  • 21
    Didn't I just say that by stating Layouts-O-Rama was my take on the problem? Anyway to make it clear for everyone, the extension was developed by me. Cheers. – mklein May 15 '13 at 06:03
  • 1
    This seems like a good solution, although so far I've only gotten it to re-size all windows *except* the main VS window. – Carlos P Jul 17 '13 at 07:58
  • 2
    It can't resize the main VS window, that's not a tool window, and it works differently. You can use the tool called "Sizer" to change that, if you want, Carlos P. – Lucas Fowler Jan 07 '14 at 19:29
  • I didn't know about Sizer, I'm about to give that a try. Thanks for the tip. – Coder_Dan May 19 '14 at 16:24
  • Just a short update. As of version 1.4.0.0 resizing and position of the main VS window is retained as well (optional). – mklein Feb 28 '15 at 23:58
  • Why the hard limit of 10 unique layouts? Is it much more difficult to allow unlimited layouts? – Dan Bechard Sep 03 '15 at 14:55
  • There is no actual limit... But only 10 can have a shortcut assigned. – mklein Sep 04 '15 at 21:11
  • @mklein very nice, don't suppose there is anyway I can restore a snaphot externally? (e.g. command line) I just forked an existing project https://github.com/chrispepper1989/WindowsLayoutSnapshot, to get it to automatically restore my window positions when I dock & undock my laptop, adding the ability to auto-restore VS windows as well would be the icing on the cake :) (and if i'm honest, the whole reason I wanted to do it :)) – chrispepper1989 Mar 30 '16 at 10:25
  • The addin supports 10 VS commands. You could try to assign the required layouts accordingly and execute these commands from your addin. – mklein Apr 01 '16 at 05:54
33

I am excited to let you know that with the Visual Studio "14" CTP2 release, we have added a Custom Layouts feature which enables users to save, apply and manage custom window layouts.

Details about the CTP2 release can be found here: http://blogs.msdn.com/b/visualstudio/archive/2014/07/08/visual-studio-14-ctp-2-available.aspx

Save and Apply Custom IDE Layouts.
You can now save and apply custom layouts for tool windows in the IDE. The Save Window Layout and Apply Window Layout commands are under the Window Menu and you can also rename, reorder, and delete layouts from Manage Window Layouts.

We would love to hear your feedback about this feature. Please send us any feedback using the built in "Send a Smile" menu (see http://msdn.microsoft.com/en-us/library/zzszcehe.aspx).

Thanks!
Praveen Sethuraman
Visual Studio IDE Experience Team

jpaugh
  • 6,634
  • 4
  • 38
  • 90
  • Love it! http://www.alexdresko.com/2014/11/14/window-layout-management-in-visual-studio-2015/ – Alex Dresko Nov 14 '14 at 20:52
  • 2
    @Praveen thanks for giving an insight from the VS team. Ideally, you want to add your signature in your profile page and not sign your posts. That is the practice here. Another point to note is including relevant excerpts from the linked articles into your post here to avoid link rot. I've edited your answer to reflect the same. – bPratik Jan 18 '16 at 11:14
  • 1
    @bPratik Good points --- except that the signature was the only disclosure of affiliation with MS or the Visual Studio team (and the post makes less sense without that). I opted to use OP's original text, rather than write it in elsewhere from OP's point of view. – jpaugh Jan 25 '18 at 17:42
6

In visual studio 2015/2017/2019, you can go to Window -> Save Window Layout. You can save multiple layouts. I do not think this works across devices.

enter image description here

barshopen
  • 1,190
  • 2
  • 15
  • 28
Thomas Bailey
  • 191
  • 2
  • 6