删除优秀文本2和3中的项目。

时间:2022-02-18 02:23:55

How do you remove a project from Sublime Text 2 and 3's project windows (Ctrl+Alt+P) ?

如何从卓越的文本2和3的项目窗口中移除一个项目(Ctrl+Alt+P) ?

Delete has no effect, there is no contextual menu, and deleting the associated files *.sublime-project and *.sublime-workspace doesn't remove the project from the list either.

删除无效,没有上下文菜单,并删除相关的文件*。sublime-project和*。sublime-workspace并没有从列表中移除项目。

Any idea? Because this window begins to be cluttered...

任何想法?因为这个窗口开始变得混乱……

4 个解决方案

#1


303  

It would be nice if Sublime Text removed projects you've deleted from the recent projects list. Unfortunately, it does not and the list can become littered with projects that no longer exist.

如果您从最近的项目列表中删除了您已经删除的项目,那将是非常好的。不幸的是,它没有,而且列表中可能会充斥着已经不复存在的项目。

Until Sublime Text offers this feature there are a couple of manual ways you can remove projects.

在卓越的文本提供这个特性之前,有一些手动方式可以删除项目。

Option 1: The quick way (Clear All):

If you're just looking for the fastest way to clean up your list this option is for you.

如果你只是在寻找最快的方法来清理你的列表,这个选项是为你准备的。

Please be aware that this will clear out all projects in the recent list. This includes ones you have not deleted.

请注意,这将清除最近列表中的所有项目。这包括你没有删除的。

In the Sublime Text menu goto:

在崇高的文本菜单中,goto:

Project > Open Recent > Clear Items

>项目最近打开> Clear Items。

删除优秀文本2和3中的项目。

Option 2: The manual way (but with control of which projects are removed):

  1. Close Sublime Text
  2. 接近崇高文本
  3. Locate the Session.sublime_session file using the paths below and open it with another code editor. * DO NOT open it with Sublime Text as any changes you make will be overwritten. *

    定位会话。使用下面的路径使用sublime_session文件,并使用另一个代码编辑器打开它。*不要用崇高的文字打开它,因为你所做的任何修改都会被改写。*

    Paths to Session.sublime_session file listed by OS and ST version:

    路径会话。OS和ST版本列出的sublime_session文件:

    Windows x64:

    Windows x64:

    Sublime Text 2

    崇高文本2

    C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session

    C:\Users\【用户名】\ AppData \ \ Session.sublime_session漫游\崇高文本2 \设置

    Sublime Text 3

    崇高文本3

    C:\Program Files\Sublime Text 3\Data\Local\Session.sublime_session

    3 \ \本地数据\ Session.sublime_session C:\Program Files\Sublime文本

    Mac OSX:

    Mac OSX:

    Sublime Text 2

    崇高文本2

    ~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session

    ~ /图书馆/应用支持/ 2 /设置/ Session.sublime_session崇高文本

    Sublime Text 3

    崇高文本3

    ~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session

    ~ /图书馆/应用支持/ 3 /地方/ Session.sublime_session崇高文本

    Linux (Ubuntu):

    Ubuntu Linux():

    Sublime Text 2

    崇高文本2

    ~/.config/sublime-text-2/Settings/Session.sublime_session

    ~ / config / sublime-text-2 /设置/ Session.sublime_session

    Sublime Text 3

    崇高文本3

    ~/.config/sublime-text-3/Local/Session.sublime_session

    ~ / config / sublime-text-3 /地方/ Session.sublime_session

    What to expect to see:

    期望看到什么:

    You should see something like the following at the bottom of this file:

    您应该在该文件的底部看到如下内容:

    删除优秀文本2和3中的项目。

  4. Remove the unwanted project(s) from this file

    从这个文件中删除不需要的项目。

    What the file would look like after deleting project3:

    删除project3之后文件的样子:

    删除优秀文本2和3中的项目。

  5. Save and re-launch Sublime Text 2/3

    保存并重新启动卓越的文本2/3。

Option 3: The plugin way

You can check out the Sublime Text plugin Project Manager.

您可以查看卓越的文本插件项目经理。

Option 4: The Node.js way

You can check out: clean-sublime-text-project-history

您可以查看:干净的sublime-text-project-history。

#2


35  

Just to clarify something in Valjas' solution above.

只是为了澄清一下Valjas的解决方案。

When he says: "Go to Sublime Preferences folder..." he means: "Go to the USER folder", not the Program folder.

当他说到:“去一个高级的偏好文件夹…”他的意思是:“去到用户文件夹”,而不是程序文件夹。


Attention: Use a different editor to modify the "Session.sublime_session" file:

Although obvious for many, it may not be for others:

虽然对很多人来说是显而易见的,但对其他人来说可能不是这样的:

You HAVE to edit the Session.sublime_session file with a different text editor, and Sublime Text itself has to be closed.

您必须编辑会话。sublime_session文件与一个不同的文本编辑器,而崇高的文本本身必须关闭。

DO NOT use Sublime Text itself, or leave the program running while making the changes.

不要使用崇高的文本本身,或者让程序在进行更改时运行。

If you do it'll overwrite your changes when closing the app.

如果你这样做,在关闭应用程序时将覆盖你的修改。


Sublime Text 3:

WINDOWS x64:

•WINDOWS x64:

C:\Users\[Username]\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session

C:\Users\【用户名】\ AppData \ \崇高当地文本3 \ \ Session.sublime_session徘徊

Linux (Ubuntu):

•Linux(Ubuntu):

~/.config/sublime-text-3/Local/Session.sublime_session

~ / config / sublime-text-3 /地方/ Session.sublime_session

Mac OSX/Sierra:

•Mac OSX /塞拉:

~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session

~ /图书馆/应用支持/ 3 /地方/ Session.sublime_session崇高文本

Portable Installation (It might work for ST2 as well but I haven't tested):

•可移植安装(它可能也适用于ST2,但我还没有测试):

/folder-where-you-have-ST3-installed/Data/Local/Session.sublime_session

/ folder-where-you-have-ST3-installed /数据/地方/ Session.sublime_session

--

- - -

Sublime Text 2:

WINDOWS x64:

•WINDOWS x64:

C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session

C:\Users\【用户名】\ AppData \ \ Session.sublime_session漫游\崇高文本2 \设置

Mac OSX:

•Mac OSX:

~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session" then find the section "recent_workspaces".

~ /图书馆/应用支持/崇高文本2 /设置/会话。sublime_session“然后找到“最近工作空间”部分。

Linux (Ubuntu):

•Linux(Ubuntu):

~/.config/sublime-text-2/Settings/Session.sublime_session

~ / config / sublime-text-2 /设置/ Session.sublime_session


Where To Edit The File

Easy, look for the "recent_workspaces" section, it's usually at the bottom of the file.

简单,查找“最近的工作区”部分,它通常位于文件的底部。

It should look similar to this:

它应该看起来和这个相似:

删除优秀文本2和3中的项目。


Credits

  1. ST3 Linux (Ubuntu) / Build 3047 path added from @ezrepotein4's comment.

    ST3 Linux (Ubuntu) / Build 3047 path添加了@ezrepotein4的评论。

  2. ST2 Linux (Ubuntu) path added from @0x4a6f4672's comment.

    ST2 Linux (Ubuntu)路径添加了@0x4a6f4672的注释。

  3. Windows x64 and Mac paths taken from this post.

    从这篇文章中截取的Windows x64和Mac路径。

#3


1  

Sublime Text 2: To clean up sublime file history, project history, autocomplete history and find/replace history do the following

崇高的文字2:清理崇高的档案历史,项目历史,自动完成的历史和发现/替换历史做如下。

  1. Close all instances of sublime text 2.
  2. 关闭所有崇高文本的实例。
  3. Delete the file Session.sublime-session in Settings directory.
  4. 删除文件会话。sublime-session在设置目录中。
  5. Start up sublime
  6. 启动崇高

When you close sublime again and look up the settings directory, it will still have a Session.sublime-session file because sublime re-created it but its size shall be smaller than the one you had earlier cos it doesn't contain any junk data from previous projects history etc.

当您再次关闭sublime并查找设置目录时,它仍然会有一个会话。sublime-session文件,因为崇高重新创建了它,但是它的大小应该比你之前的版本要小,因为它不包含以前项目历史上的任何垃圾数据等等。

I hope this shall improve startup times for sublime text 2. You may choose to take a backup of Session.sublime-session to a different folder incase you want to remember the project paths etc. and then copy paste the once you need using a file comparison software. Just remember to close sublime whenever you deal with Session.sublime-session i.e. if you need to make any changes in that file, you'd be making them in some other text editor like notepad++ etc.

我希望这将会为崇高的文本2改进启动时间。您可以选择对会话进行备份。如果你想要记住项目路径等,你可以在一个不同的文件夹中使用sublime-session,然后在需要使用文件比较软件时复制粘贴。只要记住,当你处理会话的时候,就关闭崇高。sublime-session,即如果你需要在文件中做任何修改,你可以在其他的文本编辑器中做,比如notepad++等。

#4


0  

for MacOS High Sierra

MacOS高塞拉

you need to modify Session.sublime_session file which can be found with 3 approaches

您需要修改会话。sublime_session文件,可以通过3种方法找到。

via terminal

cd ~/Library/Application Support/Sublime Text 3/Local/

via Sublime Text 3

click on the first menu

点击第一个菜单。

Sublime Text > Preferences > Browse Packages...

it will open the location in Finder which is

它将打开Finder中的位置。

Macintosh HD > Users > username (with home icon) > Library > Application Support > Sublime Text 3 > Packages

Macintosh HD >用户>用户名(带有home图标)>库>应用支持>卓越文本3 >包。

move up to one folder up and click on Local folder

向上移动到一个文件夹,然后点击本地文件夹。

from Finder

Macintosh HD >> Users >> username ( with home icon ) > Library ( this will be hidden folder by default, click command + shift + . ) >> Aplication Support > Sublime Text 3 > Local

Macintosh HD >>用户>>用户名(带有home图标)>库(默认为隐藏文件夹,点击命令+ shift +)。>>的Aplication支持>崇高的文本3 >本地。

and edit the file Session.sublime_session in other than the sublime-text editor

并编辑文件会话。sublime_session,而不是sublime-text编辑器。

 

 

#1


303  

It would be nice if Sublime Text removed projects you've deleted from the recent projects list. Unfortunately, it does not and the list can become littered with projects that no longer exist.

如果您从最近的项目列表中删除了您已经删除的项目,那将是非常好的。不幸的是,它没有,而且列表中可能会充斥着已经不复存在的项目。

Until Sublime Text offers this feature there are a couple of manual ways you can remove projects.

在卓越的文本提供这个特性之前,有一些手动方式可以删除项目。

Option 1: The quick way (Clear All):

If you're just looking for the fastest way to clean up your list this option is for you.

如果你只是在寻找最快的方法来清理你的列表,这个选项是为你准备的。

Please be aware that this will clear out all projects in the recent list. This includes ones you have not deleted.

请注意,这将清除最近列表中的所有项目。这包括你没有删除的。

In the Sublime Text menu goto:

在崇高的文本菜单中,goto:

Project > Open Recent > Clear Items

>项目最近打开> Clear Items。

删除优秀文本2和3中的项目。

Option 2: The manual way (but with control of which projects are removed):

  1. Close Sublime Text
  2. 接近崇高文本
  3. Locate the Session.sublime_session file using the paths below and open it with another code editor. * DO NOT open it with Sublime Text as any changes you make will be overwritten. *

    定位会话。使用下面的路径使用sublime_session文件,并使用另一个代码编辑器打开它。*不要用崇高的文字打开它,因为你所做的任何修改都会被改写。*

    Paths to Session.sublime_session file listed by OS and ST version:

    路径会话。OS和ST版本列出的sublime_session文件:

    Windows x64:

    Windows x64:

    Sublime Text 2

    崇高文本2

    C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session

    C:\Users\【用户名】\ AppData \ \ Session.sublime_session漫游\崇高文本2 \设置

    Sublime Text 3

    崇高文本3

    C:\Program Files\Sublime Text 3\Data\Local\Session.sublime_session

    3 \ \本地数据\ Session.sublime_session C:\Program Files\Sublime文本

    Mac OSX:

    Mac OSX:

    Sublime Text 2

    崇高文本2

    ~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session

    ~ /图书馆/应用支持/ 2 /设置/ Session.sublime_session崇高文本

    Sublime Text 3

    崇高文本3

    ~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session

    ~ /图书馆/应用支持/ 3 /地方/ Session.sublime_session崇高文本

    Linux (Ubuntu):

    Ubuntu Linux():

    Sublime Text 2

    崇高文本2

    ~/.config/sublime-text-2/Settings/Session.sublime_session

    ~ / config / sublime-text-2 /设置/ Session.sublime_session

    Sublime Text 3

    崇高文本3

    ~/.config/sublime-text-3/Local/Session.sublime_session

    ~ / config / sublime-text-3 /地方/ Session.sublime_session

    What to expect to see:

    期望看到什么:

    You should see something like the following at the bottom of this file:

    您应该在该文件的底部看到如下内容:

    删除优秀文本2和3中的项目。

  4. Remove the unwanted project(s) from this file

    从这个文件中删除不需要的项目。

    What the file would look like after deleting project3:

    删除project3之后文件的样子:

    删除优秀文本2和3中的项目。

  5. Save and re-launch Sublime Text 2/3

    保存并重新启动卓越的文本2/3。

Option 3: The plugin way

You can check out the Sublime Text plugin Project Manager.

您可以查看卓越的文本插件项目经理。

Option 4: The Node.js way

You can check out: clean-sublime-text-project-history

您可以查看:干净的sublime-text-project-history。

#2


35  

Just to clarify something in Valjas' solution above.

只是为了澄清一下Valjas的解决方案。

When he says: "Go to Sublime Preferences folder..." he means: "Go to the USER folder", not the Program folder.

当他说到:“去一个高级的偏好文件夹…”他的意思是:“去到用户文件夹”,而不是程序文件夹。


Attention: Use a different editor to modify the "Session.sublime_session" file:

Although obvious for many, it may not be for others:

虽然对很多人来说是显而易见的,但对其他人来说可能不是这样的:

You HAVE to edit the Session.sublime_session file with a different text editor, and Sublime Text itself has to be closed.

您必须编辑会话。sublime_session文件与一个不同的文本编辑器,而崇高的文本本身必须关闭。

DO NOT use Sublime Text itself, or leave the program running while making the changes.

不要使用崇高的文本本身,或者让程序在进行更改时运行。

If you do it'll overwrite your changes when closing the app.

如果你这样做,在关闭应用程序时将覆盖你的修改。


Sublime Text 3:

WINDOWS x64:

•WINDOWS x64:

C:\Users\[Username]\AppData\Roaming\Sublime Text 3\Local\Session.sublime_session

C:\Users\【用户名】\ AppData \ \崇高当地文本3 \ \ Session.sublime_session徘徊

Linux (Ubuntu):

•Linux(Ubuntu):

~/.config/sublime-text-3/Local/Session.sublime_session

~ / config / sublime-text-3 /地方/ Session.sublime_session

Mac OSX/Sierra:

•Mac OSX /塞拉:

~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session

~ /图书馆/应用支持/ 3 /地方/ Session.sublime_session崇高文本

Portable Installation (It might work for ST2 as well but I haven't tested):

•可移植安装(它可能也适用于ST2,但我还没有测试):

/folder-where-you-have-ST3-installed/Data/Local/Session.sublime_session

/ folder-where-you-have-ST3-installed /数据/地方/ Session.sublime_session

--

- - -

Sublime Text 2:

WINDOWS x64:

•WINDOWS x64:

C:\Users\[Username]\AppData\Roaming\Sublime Text 2\Settings\Session.sublime_session

C:\Users\【用户名】\ AppData \ \ Session.sublime_session漫游\崇高文本2 \设置

Mac OSX:

•Mac OSX:

~/Library/Application Support/Sublime Text 2/Settings/Session.sublime_session" then find the section "recent_workspaces".

~ /图书馆/应用支持/崇高文本2 /设置/会话。sublime_session“然后找到“最近工作空间”部分。

Linux (Ubuntu):

•Linux(Ubuntu):

~/.config/sublime-text-2/Settings/Session.sublime_session

~ / config / sublime-text-2 /设置/ Session.sublime_session


Where To Edit The File

Easy, look for the "recent_workspaces" section, it's usually at the bottom of the file.

简单,查找“最近的工作区”部分,它通常位于文件的底部。

It should look similar to this:

它应该看起来和这个相似:

删除优秀文本2和3中的项目。


Credits

  1. ST3 Linux (Ubuntu) / Build 3047 path added from @ezrepotein4's comment.

    ST3 Linux (Ubuntu) / Build 3047 path添加了@ezrepotein4的评论。

  2. ST2 Linux (Ubuntu) path added from @0x4a6f4672's comment.

    ST2 Linux (Ubuntu)路径添加了@0x4a6f4672的注释。

  3. Windows x64 and Mac paths taken from this post.

    从这篇文章中截取的Windows x64和Mac路径。

#3


1  

Sublime Text 2: To clean up sublime file history, project history, autocomplete history and find/replace history do the following

崇高的文字2:清理崇高的档案历史,项目历史,自动完成的历史和发现/替换历史做如下。

  1. Close all instances of sublime text 2.
  2. 关闭所有崇高文本的实例。
  3. Delete the file Session.sublime-session in Settings directory.
  4. 删除文件会话。sublime-session在设置目录中。
  5. Start up sublime
  6. 启动崇高

When you close sublime again and look up the settings directory, it will still have a Session.sublime-session file because sublime re-created it but its size shall be smaller than the one you had earlier cos it doesn't contain any junk data from previous projects history etc.

当您再次关闭sublime并查找设置目录时,它仍然会有一个会话。sublime-session文件,因为崇高重新创建了它,但是它的大小应该比你之前的版本要小,因为它不包含以前项目历史上的任何垃圾数据等等。

I hope this shall improve startup times for sublime text 2. You may choose to take a backup of Session.sublime-session to a different folder incase you want to remember the project paths etc. and then copy paste the once you need using a file comparison software. Just remember to close sublime whenever you deal with Session.sublime-session i.e. if you need to make any changes in that file, you'd be making them in some other text editor like notepad++ etc.

我希望这将会为崇高的文本2改进启动时间。您可以选择对会话进行备份。如果你想要记住项目路径等,你可以在一个不同的文件夹中使用sublime-session,然后在需要使用文件比较软件时复制粘贴。只要记住,当你处理会话的时候,就关闭崇高。sublime-session,即如果你需要在文件中做任何修改,你可以在其他的文本编辑器中做,比如notepad++等。

#4


0  

for MacOS High Sierra

MacOS高塞拉

you need to modify Session.sublime_session file which can be found with 3 approaches

您需要修改会话。sublime_session文件,可以通过3种方法找到。

via terminal

cd ~/Library/Application Support/Sublime Text 3/Local/

via Sublime Text 3

click on the first menu

点击第一个菜单。

Sublime Text > Preferences > Browse Packages...

it will open the location in Finder which is

它将打开Finder中的位置。

Macintosh HD > Users > username (with home icon) > Library > Application Support > Sublime Text 3 > Packages

Macintosh HD >用户>用户名(带有home图标)>库>应用支持>卓越文本3 >包。

move up to one folder up and click on Local folder

向上移动到一个文件夹,然后点击本地文件夹。

from Finder

Macintosh HD >> Users >> username ( with home icon ) > Library ( this will be hidden folder by default, click command + shift + . ) >> Aplication Support > Sublime Text 3 > Local

Macintosh HD >>用户>>用户名(带有home图标)>库(默认为隐藏文件夹,点击命令+ shift +)。>>的Aplication支持>崇高的文本3 >本地。

and edit the file Session.sublime_session in other than the sublime-text editor

并编辑文件会话。sublime_session,而不是sublime-text编辑器。