Documentation Command Palette

The commands available in the command palette of Sublime Merge are defined by files ending in .sublime-commands. Commands files use JSON, with the top-level structure being an array. Each command is a JSON object.

Example

The following is an example of the format of a .sublime-commands file.

[
    {
        "caption": "View: Toggle Side Bar",
        "command": "toggle_side_bar"
    },
    {
        "caption": "Checkout Branch…",
        "command": "checkout_branch",
    },
    {
        "caption": "Checkout Remote Branch…",
        "command": "checkout_branch",
        "args": { "local_refs": false, "remote_refs": true }
    },
]

Entries

Each command palette entry requires two keys, "caption" and "command". To pass args to a command, the "args" key may be specified.

The "caption" value must be a string, and specifies the text to display in the command palette. The "command" value must also be a string, and specifies the name of the command to execute.

An entry for viewing the tree of the selected commit

{
    "caption": "View Tree",
    "command": "view_tree"
}

The args value must be an object, with each key being the name of the arg to pass to the command.

An entry to push the current branch, but prompting the user to select options

{
    "caption": "Push...",
    "command": "push",
    "args": {"prompt": true}
}

User Entries

Users can add entries to their command palette by creating a file named Default.sublime-commands in their Packages/User/ directory.

For example, the following will create an entry to clean up the current repo.

[
    {
        "caption": "Cleanup Repo",
        "command": "git",
        "args": {"argv": ["gc"]}
    }
]