Sublime Text Git Key Bindings

Peter Rukavina

In recent years I’ve ended up using Sublime Text as my coding editor of choice. From time to time I go back to BBEdit, where my heart lives, or to TextMate, but something or another ends up driving me back to Sublime. A lot of the time that something is git-related. Sublime, through the SublimeGit package, has excellent git support, but, as with all things Sublime, using it requires some keyboard fu.

For example, to make a “quick commit” it’s Shift+Command+P and then typing (at least) “quick”. And then if I want to push my commits, it’s Shift+Command+P again and then “push”.

I do this hundreds of times a day, so that adds up to a lot of typing.

To reduce some of the typing, here’s what I did.

Withing Sublime Text I selected Sublime Text > Preferences > Key Bindings - User, like this:

Sublime Text Key Bindings

In the resulting (for me, empty) file called Default (OSX).sublime-keymap I entered the following key bindings setup:

[
  { "keys": ["f1"], "command": "git_quick_commit" },
  { "keys": ["f2"], "command": "git_push" }
]

With this in place, to make a quick commit I just press F1, and then to push the commit I press F2.

Thousands of keystrokes a week saved!

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search