Reputation: 6640
I was wondering how is it possible to assign keyboard shortcut that will reset my opened VS window to my saved settings (full setting import)?
I am not talking about Tools > Import and Export Setting (I want to have a single Reset shortcut) also I am not talking just about ResetWindowLayout option (this one only resets windows layout, not all settings).
Manually all settings can be restored from saved file by going to
Too many steps, I just want to import my setting with one click, similar to ResetWindowLayout to which I can assign a keyboard shortcut.
Any ideas ?
Upvotes: 1
Views: 324
Reputation: 24719
Install the macro extension from Microsoft. https://visualstudiogallery.msdn.microsoft.com/d3fbf133-e51b-41a2-b86f-9560a96ff62b/view/Reviews
Create two macro files. Adjust your paths. (I think you need to keep the commented reference path.
SaveSettings:
dte.ExecuteCommand("Tools.ImportandExportSettings", "-export:C:\\Docs\\VS2013\\Settings\\BACKUP.vssettings");
LoadSettings:
dte.ExecuteCommand('Tools.ImportandExportSettings', '-import:C:\\Docs\\VS2013\\Settings\\BACKUP.vssettings');
Your are in luck. We both had this same question today and I was considering making something myself before stumbling on this.
This supports saving and loading settings as profile names.
Even better, you can set a solution to default to a particular settings profile. Useful if your project is a web project to appear as a certain layout. Or a class library project with unit testing layouts. Or even for switching between multi and single monitor.
One of the tests I performed with this tool was to not only close and move around my tool windows, but I deleted icons from my toolbars. I then restored all my changes by applying the saved profile.
Upvotes: 2