Sublime Forum

Customizing key bindings of SublimeMerge

#1

I would like to customize the key binding for “commit”. However I cannot seem to find the list of commands that one can use with the key bindings. When I choose key bindings from the Preferences the list is completely empty. Where are the default key bindings?

Thanks,

0 Likes

#2

Unlike Text, in Merge the key binding menu entry opens your key bindings file (which is why it’s empty), but it doesn’t also open the default bindings file for you. See the post linked below for how to get a look at those. You may also want to peek into the documentation on key bindings in Merge to get a sense of the context types that are available to you as well.

Aside of that, much like how in Sublime you can open the console and use sublime.log_commands(True) to see commands be logged in the console, you can do the same thing in Merge by adding a log_commands setting to your Preferences (also log_input and log_control_tree, if you’re familiar with those).

    "log_commands": true

To add the setting, you need to choose Preferences > Settings to open the file and edit it (it doesn’t appear in the preferences dialog).

0 Likes

#3

Just in case it comes in handy to anyone, this is what I did, and it works:

[
    { "keys": ["ctrl+enter"], "command": "commit", "args": { "mode": "commit" },
      "context": [{ "key": "setting.commit_message" }, { "key": "can_commit" }]
    },
    { "keys": ["ctrl+keypad_enter"], "command": "commit", "args": { "mode": "commit" },
        "context": [{ "key": "setting.commit_message" }, { "key": "can_commit" }]
    },
]
0 Likes