5

I'm not asking how to tell footnotes how to do this - I'm using this line in the initializers/footnotes.rb file:

Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'

My question is what should go in place of the txmt://open?...? I've tried subl:// and sblm:// but no joy. Is it something to do with the open?url= etc?

Jules Copeland
  • 1,690
  • 17
  • 22

2 Answers2

9

subl-handler works by interpreting txmt urls, and forwarding them to Sublime. If you, like me, have TextMate or any other application currently responding to txmt, then subl-handler will never run, and won't be able to help you. If that's the case, you need a utility like RCDefaultApp to change the default handler for txmt urls from TextMate (or whatever it currently is) to subl-handler.

So, the full instructions (per here) are:

  1. Github repo for subl-handler project Install & configure subl-handler
  2. Install RCDefaultApp
  3. Open the RCDefaultApp preference pane, and tell it to use subl-handler (not Sublime) for txmt URLs.
westonplatter
  • 1,475
  • 2
  • 19
  • 30
Taavo
  • 2,406
  • 1
  • 17
  • 17
  • This has got me the furthest so far... I've got it opening sublime for txmt:// links, but it's not opening the actual file - did you manage to get it to do that? – Jules Copeland Jul 24 '12 at 08:55
  • You're totally right. After some further troubleshooting, I think I got it, though. Updating above. – Taavo Jul 24 '12 at 13:16
  • 2
    @JulesCopeland, @Taavo, did these exact instructions work for you on OSX 10.6.8? I just attempted to open subl-handler as downloaded from the link in the answer and got a `SublHandler quit unexpectedly` error. – Paul Fioravanti Oct 21 '12 at 03:11
  • Got it working on OSX 10.6.8 by doing the following (I'm sure there's a better way...): Downloaded a zip of [Scott Wadden's repo of Sublhandler](https://github.com/dsrw/subl-handler) not from the broken download link in the README, but a zip of the repo. Unzipped the file, copied the Debug app from `build/Debug/SublHandler.app` into my Applications folder, and then completed the [instructions on the rails_footnotes repo](https://github.com/josevalim/rails-footnotes#hooks) for Sublime Text 2. Hope this helps someone else who's wondering why the SublHandler app is crashing for them. – Paul Fioravanti Oct 21 '12 at 03:46
5

Sublime Text 2 doesn't have a protocol handler. However, you can map textmate's txmt to Sublime Text using this app: https://github.com/hiddenbek/subl-handler

There is also a Sublime Text plugin that adds a sblm: url handler (Windows-only): https://bitbucket.org/sublimator/sublimeprotocol/src/

Liam Cain
  • 13,283
  • 5
  • 39
  • 29