Safari View Source in TextMate

Shaun, Nov 21

While I love developing in Safari over alternatives like Firefox and Chrome, it lacks in one particular area: View Source.  Safari's View Source is practically useless, it doesn't show line numbers, no syntax highlighting, etc.

Safari does offer the Web Inspect, which is nice, but a little annoying for quick look ups since everything is broken down into the DOM tree.

I've seen other Safari Extension's like BetterSource that do this right in the browser, but really, why re-invent the wheel?  TextMate is an awesome editor (albeit with this issues) and would be perfect for this.

I decided to see if I could get a "View Source in TextMate" item in the contextual menu.  After reading over all of the docs, it became apparent to me that opening files in a native app just wasn't going to happen.

I was able to get it to work by writing a TextMate plugin to handle the heavy lifting via it's txmt:// URL scheme.  So it all worked out in the end, you'll just need to install the TextMate plugin as well as the Safari extension.  Enjoy!

Download the ViewSourceInTextMate TextMate Plugin

Download the ViewSourceInTextMate Safari Extension

blog comments powered by Disqus