22

Is there an add-in for Visual Studio that lets you save the list of files/tabs you currently have open in Visual Studio, like the session manager you get built-in to Opera?

I don't mean how can I save all currently open files (Ctrl + Shift + S) or how can I get all the files I have open reopened when I reopen Visual Studio.

I mean how can I have a set of files open for one issue/bug, then save that list when another more important issue/bug comes up then reopen the saved list of files I previously had open. That way I wouldn't have to gp and find all the files I had open originally or have to keep lots of files open at once.

Thanks

Keith

Keith K
  • 2,893
  • 4
  • 33
  • 43
  • 1
    See also [How can I save opened tabs and tab groups in Visual Studio 2012?](http://stackoverflow.com/questions/19378005/how-can-i-save-opened-tabs-and-tab-groups-in-visual-studio-2012) – Jarrod Dixon Feb 15 '15 at 21:01

5 Answers5

14

Save All The Tabs is a great extension that seems to perfectly satisfy this request. I'm dropping it here since this post comes up in the first few google results for "visual studio save tabs".

Mushkov
  • 451
  • 4
  • 5
  • 1
    Doesn't work that will. It looks like it's saving the list of files but it can't open them all. – goamn Nov 21 '16 at 02:26
  • 1
    Author doesn't use VS anymore so VS2017 work is limited. Also does not save sets in any sort of settings file. Probably uses registry. Lack of file saves makes it much less useful for GIT work. – secretwep Jun 01 '17 at 22:43
5

Document Session Manager add-in appears to provide the functionality you are after. However, it hasn't been updated since April 2010.

Favorite Documents extension lets you create links to frequently used code files and then quickly open them as a group or individually from the Favorites menu in Visual Studio 2010, 2012 and 2013.

Jarrod Dixon
  • 15,727
  • 9
  • 60
  • 72
Aaron McIver
  • 24,527
  • 5
  • 59
  • 88
1

Simple macro template:

Public Module Sessions
    Sub Session1()
        DTE.ItemOperations.OpenFile("fullPathFile1")
        DTE.ItemOperations.OpenFile("fullPathFile2")
        ...
        DTE.ActiveDocument.Activate()
    End Sub
End Module
Luca
  • 47
  • 6
  • That doesn't generalize well at all, it would be a ridiculous amount of overhead to do for every project and every time the workspace session needed to change. – Logos Sep 27 '16 at 16:24
0

@Ben hinted at the answer, but that will only work for one set of files (i.e. if you close and re-open a solution you should find the same files open as you had previously).

One mildly hacky work-around would be to manually maintain different versions of the .suo file (insert all appropriate disclaimers here), though that would force you to close and open the solution each time.

PS: 3 minutes on Google, didn't find anything. I expect it shouldn't be too hard to knock up a macro to do this.

Benjol
  • 63,995
  • 54
  • 186
  • 268
0

Late to the party but ContextKeeper plugin will do the job. Supports VS 2022/2019/2017/2015/2013.

It's an extension to quickly save and restore sets of document tabs and its metadata. The "session", similar to Vim's :mksession command, is defined as:

  • last opened/favorites files
  • documents (tabs with code) positions, state and order
  • tabs groups (including horizontal/vertical orientation)
  • remembers line&column for every opened tab

It also has a powerful git integration - automatically saves and restores context when switching between branches.

All contexts are saved to simple JSON files.