ST3 打开最近 - 如何快捷方式?

mar*_*art 5 keyboard-shortcuts sublime-text-3

How do I make ST3 shortcut for menu command 'File › Open Recent'? Is there an ST3 plugin that provides/allows 'Open Recent' shortcut?

ST2 had 'Open Recent' plugins with shortcuts [packagecontrol.io] - GoToRecent was Shift-Command-R and OpenRecentFiles was Command-R. Installing those plugins, users could use shortcuts to open the list of recent files displayed by menu command 'Open Recent'. Those shortcuts worked in ST2, but in ST3 the plugins are no longer supported. ST3 uses the ST2 plugin shortcuts: Command-R is now 'Go to Symbol' and Shift-Command-R is now 'Go to Symbol in Project'...

Sublime Text › Preferences › Key Bindings... 'open' and 'recent' not even present.

Mac System Preferences › Keyboard › Shortcuts › App shortcuts... Try many shortcuts, nothing works. 'Unofficial Documentation' would indicate that we need to target a plugin behavior with a shortcut. Sublime Key Bindings are not available, so that plugin would have to provide keybindings to support its own shortcut.

Kar*_*bur 2

我知道你问这个问题已经一年了,但是......

您可以使用打开“快速切换项目”对话框ctrl+alt+p(这实际上是运行命令prompt_select_workspace)。从对话框中选择一个项目将关闭当前项目并将其替换为所选项目。虽然这有其用处,但我实际上想同时打开多个最近的项目。

我最终做的是映射ctrl+super+p 1以打开最近的项目、ctrl+super+p 2下一个最近的项目,依此类推前 5 个项目。因此,要打开最近的项目,我依次ctrl+super+p点击1

我通过将键盘映射添加到用户的默认键盘映射来做到这一点。要自己执行此操作,请从主菜单中选择“首选项”->“按键绑定”。Sublime 将打开 2 个文件:“Default”(左侧)和“User”(右侧)。将以下内容添加到“用户”文件中:

{ "keys": ["ctrl+super+p", "1"], "command": "open_recent_project_or_workspace", "args": {"index" : 0} },
{ "keys": ["ctrl+super+p", "2"], "command": "open_recent_project_or_workspace", "args": {"index" : 1} },
{ "keys": ["ctrl+super+p", "3"], "command": "open_recent_project_or_workspace", "args": {"index" : 2} },
{ "keys": ["ctrl+super+p", "4"], "command": "open_recent_project_or_workspace", "args": {"index" : 3} },
{ "keys": ["ctrl+super+p", "5"], "command": "open_recent_project_or_workspace", "args": {"index" : 4} },
Run Code Online (Sandbox Code Playgroud)

它应该看起来像这样: 在此输入图像描述

您可以映射类似crtl+super+o 1打开最近文件的内容(我经常crtl+shitft+t撤消上次关闭的文件......)。在同一个“用户”文件中,添加:

{ "keys": ["ctrl+super+o", "1"], "command": "open_recent_file", "args": {"index" : 0} },
{ "keys": ["ctrl+super+o", "2"], "command": "open_recent_file", "args": {"index" : 1} },
{ "keys": ["ctrl+super+o", "3"], "command": "open_recent_file", "args": {"index" : 2} },
{ "keys": ["ctrl+super+o", "4"], "command": "open_recent_file", "args": {"index" : 3} },
{ "keys": ["ctrl+super+o", "5"], "command": "open_recent_file", "args": {"index" : 4} },
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助!