我最近来需要这些版本打开文件/文件夹。
然而,问题是我不想过度填充主菜单。我创建了一个显示其他文件/文件夹的子菜单项。
除了来自@ptim 和@MoonLite 的上述出色答案之外,我还创建了一个子菜单,以防止它被大量条目过度拥挤。在 Windows 上,路径是(使用自定义 scoop 目录时:C:\app_scoop\apps\sublime-text\current\Data\Packages\Default)。
我发现您确实可以超载菜单。只需复制出Main.sublime-menu;用下面的代码修改它并将其放入C:\app_scoop\apps\sublime-text\current\Data\Packages\Default,您将拥有带有子菜单的自定义菜单。
我正在共享一种查看文件/文件夹的子菜单方式(使用目录而不是文件夹来获得更简单的快捷方式 F...文件,D...目录):
{
"caption": "File",
"mnemonic": "F",
"id": "file",
"children":
[
{ "command": "new_file", "caption": "New File", "mnemonic": "N" },
{ "command": "prompt_open_file", "caption": "Open File…", "mnemonic": "O", "platform": "!OSX" },
{ "command": "prompt_open_folder", "caption": "Open Folder…", "platform": "!OSX" },
{ "command": "prompt_open", "caption": "Open…", "platform": "OSX" },
{
"caption": "Open Recent",
"mnemonic": "R",
"children":
[
{ "command": "reopen_last_file", "caption": "Reopen Closed File" },
{ "caption": "-" },
{ "command": "open_recent_file", "args": {"index": 0 } },
{ "command": "open_recent_file", "args": {"index": 1 } },
{ "command": "open_recent_file", "args": {"index": 2 } },
{ "command": "open_recent_file", "args": {"index": 3 } },
{ "command": "open_recent_file", "args": {"index": 4 } },
{ "command": "open_recent_file", "args": {"index": 5 } },
{ "command": "open_recent_file", "args": {"index": 6 } },
{ "command": "open_recent_file", "args": {"index": 7 } },
{ "caption": "-" },
{ "caption": "More Recent Files",
"mnemonic": "F",
"children":
[
{ "command": "open_recent_file", "args": {"index": 8 } },
{ "command": "open_recent_file", "args": {"index": 9 } },
{ "command": "open_recent_file", "args": {"index": 10 } },
{ "command": "open_recent_file", "args": {"index": 11 } },
{ "command": "open_recent_file", "args": {"index": 12 } },
{ "command": "open_recent_file", "args": {"index": 13 } },
{ "command": "open_recent_file", "args": {"index": 14 } },
{ "command": "open_recent_file", "args": {"index": 15 } },
{ "command": "open_recent_file", "args": {"index": 16 } },
{ "command": "open_recent_file", "args": {"index": 17 } },
{ "command": "open_recent_file", "args": {"index": 18 } },
{ "command": "open_recent_file", "args": {"index": 19 } },
{ "command": "open_recent_file", "args": {"index": 20 } },
]
},
{ "caption": "-" },
{ "command": "open_recent_folder", "args": {"index": 0 } },
{ "command": "open_recent_folder", "args": {"index": 1 } },
{ "command": "open_recent_folder", "args": {"index": 2 } },
{ "command": "open_recent_folder", "args": {"index": 3 } },
{ "command": "open_recent_folder", "args": {"index": 4 } },
{ "command": "open_recent_folder", "args": {"index": 5 } },
{ "command": "open_recent_folder", "args": {"index": 6 } },
{ "command": "open_recent_folder", "args": {"index": 7 } },
{ "caption": "-" },
{ "caption": "More Recent Directories",
"mnemonic": "D",
"children":
[
{ "command": "open_recent_folder", "args": {"index": 8 } },
{ "command": "open_recent_folder", "args": {"index": 9 } },
{ "command": "open_recent_folder", "args": {"index": 10 } },
{ "command": "open_recent_folder", "args": {"index": 11 } },
{ "command": "open_recent_folder", "args": {"index": 12 } },
{ "command": "open_recent_folder", "args": {"index": 13 } },
{ "command": "open_recent_folder", "args": {"index": 14 } },
{ "command": "open_recent_folder", "args": {"index": 15 } },
{ "command": "open_recent_folder", "args": {"index": 16 } },
{ "command": "open_recent_folder", "args": {"index": 17 } },
{ "command": "open_recent_folder", "args": {"index": 18 } },
{ "command": "open_recent_folder", "args": {"index": 19 } },
{ "command": "open_recent_folder", "args": {"index": 20 } },
]
},
{ "caption": "-" },
{ "command": "clear_recent_files", "caption": "Clear Items" }
]
},
... (continued)