Sublime Forum

Keyboard shortcut to checkout a commit

#1

Sublime is generally amazing for keyboard navigation.
I can browse commits by hitting up/down on my keyboard but I wonder if it’s possible to checkout the highlighted commit with a keyboard shortcut? Currently I have to right-click to do what I want

0 Likes

#2

Key bindings can be customized very much the same way as in Sublime Text.

It’s probably just not as convinient due to missing side-by-side views.

  • create a Packages/User/Default (<os>).sublime-keymap file with following content or add it to an existing file.
[
    {   // Checkout Commit
        "keys": ["ctrl+enter"],
        "command": "checkout_branch",
        "args": {"branch": "$commit"}
    },
]
1 Like

#3

Amazing, thanks so much

0 Likes

#4

Also, to find out which command you might need, you can add
"log_commands": true, in your Preferences.sublime-settings and see what’s logged in the SM console when performing the operation.

2 Likes