Sublime Forum

Solved: New workspace & save workspace hotkeys

#1

I would like to add a hoykey for ‘new workspace for project’ and ‘save workspace as…’ I have tried a few different things in my user keymap but haven’t had any success finding the correct “command.” Is there a list of all “commands” or does anyone know the specific ones I’m looking for?

Thanks in advance.

0 Likes

#2

One way to figure out the commands would be to use View Package File from the command palette to view Default/Main.sublime-menu, which is the resource that defines the default main menu in Sublime. In there you can find the appropriate entry to see what command is being executed, which is these two:

{ "command": "new_window_for_project", "caption": "New Workspace for Project" },
{ "command": "save_workspace_as", "caption": "Save Workspace As…", "mnemonic": "A" },

You can also open the Sublime console with View > Show Console or the key binding (it’s visible in the menu) and enter the command sublime.log_commands(True). This logging will remain active until you run the command again with False or restart Sublime.

When logging is enabled, any command you execute will be logged in the console (except from the command palette due to a current bug). So you could press the associated key or pick the menu command (depending on the situation) and see in the console what command was executed and any arguments it might need.

There is a list of commands in the unofficial documentation as well, although I don’t think these commands are currently in it.

4 Likes

#3

I searched the commands page but didn’t see the Discover section of the page. This is exacty what I was looking for.

Thanks @OdatNurd, very helpful.

0 Likes