【发布时间】:2013-04-02 16:20:12
【问题描述】:
是否可以增加 Sublime Text 2 的 Projects -> Recent Projects 菜单中显示的最近项目的数量?我已经搜索了设置,但没有找到任何东西。
【问题讨论】:
标签: sublimetext2
是否可以增加 Sublime Text 2 的 Projects -> Recent Projects 菜单中显示的最近项目的数量?我已经搜索了设置,但没有找到任何东西。
【问题讨论】:
标签: sublimetext2
编辑此文件:
~/Library/Application Support/Sublime Text 2/Packages/Default/Main.sublime-menu
在第 715 行左右,您会看到:
"caption": "Recent Projects",
"mnemonic": "R",
"children":
[
{ "command": "open_recent_project", "args": {"index": 0 } },
{ "command": "open_recent_project", "args": {"index": 1 } },
{ "command": "open_recent_project", "args": {"index": 2 } },
{ "command": "open_recent_project", "args": {"index": 3 } },
{ "command": "open_recent_project", "args": {"index": 4 } },
{ "command": "open_recent_project", "args": {"index": 5 } },
{ "command": "open_recent_project", "args": {"index": 6 } },
{ "command": "open_recent_project", "args": {"index": 7 } },
{ "command": "open_recent_project", "args": {"index": 8 } },
{ "command": "open_recent_project", "args": {"index": 9 } },
{ "caption": "-" },
{ "command": "clear_recent_projects", "caption": "Clear Items" }
]
添加额外的行
{ "command": "open_recent_project", "args": {"index": n } },
I.E.
"caption": "Recent Projects",
"mnemonic": "R",
"children":
[
{ "command": "open_recent_project", "args": {"index": 0 } },
{ "command": "open_recent_project", "args": {"index": 1 } },
{ "command": "open_recent_project", "args": {"index": 2 } },
{ "command": "open_recent_project", "args": {"index": 3 } },
{ "command": "open_recent_project", "args": {"index": 4 } },
{ "command": "open_recent_project", "args": {"index": 5 } },
{ "command": "open_recent_project", "args": {"index": 6 } },
{ "command": "open_recent_project", "args": {"index": 7 } },
{ "command": "open_recent_project", "args": {"index": 8 } },
{ "command": "open_recent_project", "args": {"index": 9 } },
{ "command": "open_recent_project", "args": {"index": 10 } },
{ "caption": "-" },
{ "command": "clear_recent_projects", "caption": "Clear Items" }
]
现在你有 11 个最近的项目
【讨论】:
~/.config/sublime-text-2/Settings/Session.sublime_session(或Auto Save Session.sublime_session) . Sublime 会记住最后一百左右的条目。
对于 sublime text 3,我建议(基于 https://stackoverflow.com/a/34512015/3061838)将新文件 Main.sublime-menu 添加到您的 %APPDATA%\Sublime Text 3\Packages\User 文件夹中,其中包含以下内容
[
{
"caption": "Project",
"id": "project",
"mnemonic": "P",
"children":
[
{
"caption": "Open Recent More",
"children":
[
{ "command": "open_recent_project_or_workspace", "args": {"index": 0 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 1 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 2 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 3 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 4 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 5 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 6 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 7 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 8 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 9 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 10 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 11 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 12 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 13 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 14 } },
{ "command": "open_recent_project_or_workspace", "args": {"index": 15 } },
{ "caption": "-" },
{ "command": "clear_recent_projects_and_workspaces", "caption": "Clear Items" }
]
},
]
},]
此解决方案的优势在于它可以在 Sublime Text 更新后继续存在。缺点是您将有 2 个最近打开的菜单。
您可以选择删除索引为 0-7 的行,因为它们存在于原始菜单中。
【讨论】: