Open files and folders in same window in Sublime T

2019-03-14 06:27发布

If I open ~/foo.txt then open ~/baz/bar.txt from Terminal, Sublime Text always opens 2 different windows. It's aggravating to have all these different windows open..

I've tried changing a bunch of ST's settings, but nothing seems to fix this.

Is there a way to have ALL files and folders just open up in the same window as if I were manually adding all these folders to the project?

5条回答
forever°为你锁心
2楼-- · 2019-03-14 06:37

In Sublime Text Menu:

Preferences ->  Settings - User

Look for 'open_files_in_new_window'

And change 'true' with 'false'

查看更多
时光不老,我们不散
3楼-- · 2019-03-14 06:41

Drag files or directories to sublime window will add them to current window instead of opening new one.

查看更多
甜甜的少女心
4楼-- · 2019-03-14 06:47

Folder can be directly dragged to sidebar, or from menu bar select

  • Project --> Add Folder to Project.
查看更多
一纸荒年 Trace。
5楼-- · 2019-03-14 06:53

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.

查看更多
Root(大扎)
6楼-- · 2019-03-14 07:00

All the answers above indicate the parameter files only, but this does not work for folders. I found this solution:

  1. You need to go to the registry path HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command
  2. Change command add the parameter -a, get: C:\Program Files\Sublime Text\sublime_text.exe "%1" -a

  • Also, if You have a custom alias for the console, you can use it like this: subl . -a
查看更多
登录 后发表回答