Dr Nic

GitHub and TextMate Unite

I wanted to go from a source file to the equivalent file on github. I wanted a selection of lines in TextMate editor to also be selected when I was taken to github.com. I wanted to cut back on my senseless killing of innocent pasties.

Finally, I wanted to make a nice little video to show off the new GitHub.tmbundle.

TextMate and GitHub: Show the current file in GitHub from Dr Nic on Vimeo.

Which remote repository is it choosing?

If you have multiple remote references to github.com repositories, then the algorithm picks one in the following order:

  1. A remote named ‘github’
  2. A remote named ‘origin’
  3. The first remote for a github.com repository

What else could go in a GitHub textmate bundle?

Related posts:

  1. Packaging TextMate bundles in OS X DMGs Last week Engine Yard released a CLI for their Engine...
  2. Validate and Save your Ruby in TextMate – with secret Rubinus superpowers In some TextMate bundles, if you save a file it...
  3. Migrating project websites to github pages with sake tasks, new websites with jekyll_generator Its almost Christmas time and that means presents. It...
  4. TextMate easter egg: find bundle commands by key combo I’ve dreamed of the ability to ask TextMate “what frigging...
  5. Using Ruby within TextMate snippets and commands I didn’t know you could run Ruby within TextMate snippets....

15 Responses to “GitHub and TextMate Unite”

  1. Matt Aimonetti says:

    totally awesome!

  2. BTW it requires the git gem. Make sure you have it installed before giving a try to to yet another very useful TM bundle.

  3. Dr Nic says:

    Latest version of bundle now uses https for private repos.

  4. [...] GitHub and TextMate Unite – Another TextMate bundle from Dr. Nic. [...]

  5. Great so far! I’d love a shorthand for the “annotate” command — something that’d jump to the page for the commit that most recently changed the line you’re on.

  6. Dr Nic says:

    @andrew – yeah that’d be cool indeed. The tricky bit is that you’re looking at local versions of a file from one of several remotes and/or several branches. But I’m sure we can algorithmically find which commit changed that line to be equal to what it is now. Sounds cool indeed.

  7. PhilGeek says:

    Hmm. Just installed the bundle. I have the git gem installed. The command brings up the file in the GitHub repository but does not highlight the selected code. It is a private repository. Could this be the problem?

  8. Dr Nic says:

    @phil – I did apply a fix for the http/https issue the other day. Have you added + committed + pushed the file?

  9. Dr Nic says:

    @andrew – feature added; thx for the idea.

  10. A promising approach in software develoment where:
    - developers act as friends
    - code act as content

    I call it the developer 2.0 era.

    I would like to share you some opinion about this stuff.


  11. Peter C says:

    @Dr Nic: what happened to this bundle? When I go to http://github.com/drnic/github-tmbundle/tree/master I get “Nothing to see here yet. Move along.”

  12. Dr Nic says:

    @PeterC – this is fixed now. I was notified by Github over the weekend that the repo had become corrupt internally but its now fixed with a simple “git push origin master” Yay for DSCM.