How to Open files and folders in same window in Sublime Text on macOS?
In Sublime Text Menu:
Preferences -> Settings - User
Look for 'open_files_in_new_window
'
And change 'true'
with 'false
'
Drag files or directories to sublime window will add them to current window instead of opening new one.
Rather than editing the SublimeText default settings (as Jahnux73 suggested), you should go to Preferences -> Settings - User, and add the following:
"open_files_in_new_window": false,
The SublimeText default settings file should not be modified, as it may be overwritten by Sublime updates, and so that you'll always be able to restore the default settings. The way Sublime works is that at runtime, it reads and applies the default settings, and then reads and applies the Settings - User file. In the event of a conflict, the User settings take precedence. That way, you can add your own settings without modifying the default configs.
Folder can be directly dragged to sidebar, or from menu bar select
Project --> Add Folder to Project.
And better, since this has the same functionality as File -> Open folder
which isn't mapped to a shortcut by default. You can make this a key mapping by going to
File -> Preferences -> Key bindings
and append
{ "keys": ["ctrl+shift+o"], "command": "prompt_add_folder" },
then you can use CTRL+SHIFT+O to add a folder.