35

Is it possible to open multiple folders in the same window using Sublime Text 2?

Selecting File->Open Folder always opens the folder in a new window.

Sublime Text is an excellent editor, but this issue is a bit annoying.

cmd
  • 11,622
  • 7
  • 51
  • 61
  • 4
    For those struggling with this same issue, it is possible to drag and drop a folder onto the folders panel. I, however, am looking for a way open the folder through sublime interface e.g. via the File menu – cmd Sep 14 '13 at 04:57

4 Answers4

62

You can use the Add folder to Project... item on the Project menu to open a folder in the current Sublime Text 2 window.

With Sublime Text 2, a project is always open, even if it is anonymous and unsaved.

cmd
  • 11,622
  • 7
  • 51
  • 61
deltab
  • 2,498
  • 23
  • 28
  • is there a way to view the folder's internal file structure (like in brackets) once opened? – mango Apr 22 '14 at 21:40
5

In Sublime text 3, you can just drag and drop folders, it will open multiple folders. However i have not tried it in Sublime text 2.

Update:

Drag and drop works in Sublime text 2 as well.

Rahul R.
  • 5,965
  • 3
  • 27
  • 38
3

From what I can tell, this behavior is built in. In Packages/Default/Main.sublime-menu, the listing for Open Folder… is

{ "command": "prompt_open_folder", "caption": "Open Folder…", "platform": "!OSX" }

Unfortunately, after searching all through the installation, there's no macro or .py file with the prompt_open_folder command, so it must be a hard-coded part of the binary, which makes sense, because it's a system call to the operating system/window manager to open a file picker dialog.

It should be relatively straightforward to write a plugin to select a folder for inclusion in the current window, but unfortunately I'm not quite able to at the moment.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
0

For macOS users, use the command 'open' like so:

usr@mac ~ $ open -a "Sublime-text" "./Desktop/GitHub/uoe"

This will open all the folders in the 'uoe' directory in sublime provided you are at the root directory. For windows/Linux try finding something similar to 'open' :)

dr.drizzy
  • 101
  • 3