Open files Projects/folders in Sublime Text 3 in a new super tab in the same window on Mac OS Mojave

Open new files and folders in the same window in Sublime Text, Multiple Projects in One Window

First of all, you may need to learn how to open Sublime Text by command line from terminal. Read this article.

Tip 1:

Open one of the projects in Sublime Text just like you always do and then you only need to do the following command for the other directory you are in:

subl . -a

-a flag means to add to the last focused window instead of opening in a new window).

Other flags are found here.


The result is:

Although you can drag the root directory of the second project from the file explorer (finder on mac OS) to the sidebar of the first project Sublime Text window or open the first project and then (in the menu ) go to

Project -> Add folder to project

And get the similar result and all projects are in one environment and one sidebar as the above picture.

Moreover, You can drag your directories to the Sublime Text icon in Dock. The result will be the same.

Tip 2:

1- The first and most recommended config in the sublime text 3 settings is putting this:

“open_files_in_new_window”: false

in the user setting part (which is by default true).

cmd+,or Preferences->setting will show the setting as bellow:

2- The second config on mac OS is to click on the system Preferences.

The find the Dock and click on it.

Then for the option “Prefer tabs when opening documents” choose Always.

Then in Terminal open three projects one after the other without any flag like -a:

You will see each project has its own environment! I could not reach such config in Linux/Ubuntu if you find it please let me know how to do that.

You can run also:

subl filename_1
subl filename_2
subl filename_3

Also you can make a new blank tab with Ctrl+shift+n

Posting daily about Python, Nuclear Physicist PhD

Posting daily about Python, Nuclear Physicist PhD