用于“将项目另存为”的SublimeText键绑定?

时间:2019-05-12 22:09:33

标签: sublimetext3

SublimeText是可自定义的文本编辑器。使用默认设置时,当前没有键映射绑定到“项目/项目另存为”(v3.2.1)。

如何为该命令提供键映射?

1 个答案:

答案 0 :(得分:0)

如果在命令面板中使用View Package File并打开Default/Main.sublime-menu以查看主菜单的定义,则可以搜索菜单项的标题并找到要执行的命令:

  ...
  { "caption": "-" },
  { "command": "save_project_and_workspace_as", "caption": "Save Project As…", "mnemonic": "A" },
  { "command": "close_workspace", "caption": "Close Project", "mnemonic": "C" },
  { "command": "open_file", "args": {"file": "${project}"}, "caption": "Edit Project" },
  { "caption": "-" },
  { "command": "new_window_for_project", "caption": "New Workspace for Project" },
  { "command": "save_workspace_as", "caption": "Save Workspace As…", "mnemonic": "A" },
  { "caption": "-" },
  { "command": "prompt_add_folder", "caption": "Add Folder to Project…", "mnemonic": "d" },
  { "command": "close_folder_list", "caption": "Remove all Folders from Project", "mnemonic": "m" },
  { "command": "refresh_folder_list", "caption": "Refresh Folders", "mnemonic": "e" },
  ...

使用命令save_project_and_workspace_as,您可以使用Preferences > Key Bindings并将其绑定到所需的任何键;例如:

{
    "keys": ["ctrl+shift+p"],
    "command": "save_project_and_workspace_as",
}