Sublime Forum

Show console in Sublime Merge?

#1

I want to add key bindings for certain commands in Sublime Merge, but I don’t know what 'command to use. With Sublime Text, I would use Show Console to inspect what command each menu item generates. How can I do the same in Sublime Merge?

I most want the command verbs for the commands under Edit Commit.

0 Likes

#2

Merge doesn’t currently have a visible console; if you’re on Linux you can run it with --debug as an argument and have it display the console to the terminal, but there is no way to interact with it (e.g. to turn on logging, assuming that is possible which I don’t think it is currently).

That said, if you look in the folder where Merge is installed, alongside the binary there is a Packages folder, and inside of there is a Default.sublime-package that contains the menus and such for Merge.

If you copy that somewhere and rename it to a zip file, you can inspect the resources that way.

In particular, the Commit.sublime-menu resource contains the popup menu you get on commits (which I think is what you’re talking about here), which has the following information in it:

{
    "caption": "Edit Commit",
    "children":
    [
        {
            "caption": "Edit Commit Message",
            "command": "edit_commit",
        },
        {
            "caption": "Edit Commit Contents",
            "command": "edit_commit_contents",
            "args": { "commit": "$commit" },
        },
        {
            "caption": "Squash with Parent",
            "command": "squash_commit",
        },
        {
            "caption": "Squash Selected Commits",
            "command": "squash_commits",
        },
        {
            "caption": "Squash Selected Commits, ignoring new messages (fixup)",
            "command": "fixup_commits",
        },
        {
            "caption": "Move Commit Up",
            "command": "move_commit",
            "args": { "commit": "$commit", "down": false },
        },
        {
            "caption": "Move Commit Down",
            "command": "move_commit",
            "args": { "commit": "$commit", "down": true },
        },
        {
            "caption": "Drop Selected Commits",
            "command": "drop_commits",
        },
    ]
},

More information on all of this is available here: https://www.sublimemerge.com/docs/

1 Like

Sublime Merge key combinations
[Feature request] On move_commit, update which commit is selected
#3

Thank you, that works!

0 Likes