增加Sublime Text 2中最近项目的数量?

时间:2013-04-02 16:20:13

标签: sublimetext2

是否可以增加项目中出现的最近项目的数量 - > Sublime Text 2中的最近项目菜单?我搜索了设置,但我没有找到任何东西。

2 个答案:

答案 0 :(得分:38)

编辑此文件:

~/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 } },

"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个最近的项目

答案 1 :(得分:0)

对于崇高的文字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的行。