Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is no keyboard shortcut for menu items such as Refresh Folders. I have to use my mouse every time.

How can I define key bindings for menu items in Sublime Text 2?

share|improve this question
up vote 10 down vote accepted

First, we need to determine the name of the command performed by the menu item:

Select the Packages… menu item (on Mac OS X it's in the application menu, submenu Preferences).

Navigate into the folder Default, and look for Main.sublime-menu. Open this file, and look for an entry corresponding to the label you're looking for. In this case:

{ "command": "refresh_folder_list", "caption": "Refresh Folders", "mnemonic": "e" },

The command name we're looking for is refresh_folder_list.


Now, select the Key Bindings — User menu item. A document will open.

Add the following as an additional entry to the top level array:

{
    "keys": ["ctrl+shift+option+r"], "command": "refresh_folder_list"
}

The file should look like this after editing:

[  
    // possibly other entries in this array, each of them comma separated
    {
        "keys": ["ctrl+shift+option+r"], "command": "refresh_folder_list"
    }
]  

Save and close to assign the keyboard shortcut Ctrl-Shift-Alt-R to Refresh Folders. You can of course specify any key combination you want.

share|improve this answer
    
Thanks, very useful to know where you can find commands! – Johannes Jan 31 '13 at 16:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .