Skip to content
Scott Kuroda edited this page Nov 25, 2013 · 3 revisions

This plugin includes a number of menu entries. However, if there is one you would like that is not currently available, you may add it yourself. This page will explain how to add various menu entries.

All command entries are JSON objects. These objects will, at a minimum, contain the key command. This is the string representation of the command to run. It may also contain the key args. The value for this entry is an object containing key value pairs of the arguments.

Main Menu

The plugin includes menu entries to access key bindings and settings. To add a custom entry, create Main.sublime-menu in the Packages/User folder. This file contains a list of objects specifying what command should be run for a given entry. A top level menu entry must contain the keys caption and children. It may optionally contain the keys id and mnemonic.

The caption is the display name of the menu. The id key is a string identifying the menu entry. If an entry already exists with a given id, you may specify the id, while leaving caption out. The children reference a list of command and/or sub menu entries. Finally, mnemonic contains a character that can be used to quickly access the entry.

The below sample will create menu entries under File.

[
    {
        "mnemonic": "f",
        "id": "file",
        "children":
        [
            { "caption": "-" },
            { "caption": "New File With Name", "mnemonic": "n", "command": "advanced_new_file_new" },
            { "caption": "Rename Current File", "mnemonic": "r", "command": "advanced_new_file_move" },
            { "caption": "Delete Current File","mnemonic": "d",  "command": "advanced_new_file_delete" }
        ]
    }
]

Side Bar Menu

Buffer Context Menu

Tab Menu

Clone this wiki locally