Replicating TextMate: Comment Banner Plugin for Coda
Published 6 years 6 months ago on December 1, 2008 — 4 min read
Throughout the life of Monday By Noon, I’ve been quite public about my choice of operating system. Originally I was a Windows user, from there I switched to Linux and finally made my way to OS X. I haven’t looked back, and I’m consistently impressed with the quality of applications available, not only for Web design, but general use as well.
Choice of text editor is a very personal thing for any developer. I’ve tried nearly every editor under the sun, just to make sure I wasn’t missing out on anything. Over the past year or so, I’ve wobbled back and forth between TextMate and Coda. TextMate is brutally useful, and Coda is terribly beautiful and functional. Time after time I’d return to TextMate simply because of the elaborate bundles, especially the snippet implementation. Coda’s editor just didn’t cut it when it came down to the timesaving techniques TextMate has spoiled with me.
Then came Coda 1.6. Coda now supports a full range of plugin functionality, along with a stunning plugin creator. I was instantly thrilled, dying to give Coda a fighting chance against TextMate. Since the debut of 1.6, some really great third party plugins have been published, and I’m very excited about the potential of very elaborate plugins down the line.
Writing a Coda plugin
I’ve never been one to get very detailed with plugin development, mostly because any plugin I wanted to write had already been done (and done well). With Coda plugins being brand new, there are plenty of plugins to write; I thought I’d give it a shot.
Writing a Coda plugin is terribly easy. It’s a matter of downloading the plugin creator, choosing from a number of languages, and publishing your plugin. If you’ve never built a plugin before, I’d definitely suggest playing around with Panic’s implementation with Coda, it’s a very satisfying experience.
Comment banner plugin for Coda
Unfortunately, in its current state, my plugin is nowhere near as advanced as the TextMate implementation. In TextMate, you can simply trigger the snippet and type your comment as you go. My plugin instead uses an existing line of text and transforms that into a comment banner. Once I take a closer look at the Coda plugin architecture, I’d like to completely duplicate the TextMate implementation.
Another feature that’s currently incomplete is the syntax mode detection. I’ve only had time to implement a few of the document types I find myself editing most often. Once I look into the comment syntax of all the modes supported by Coda, I’ll make additions to make the plugin that much more comprehensive. Of course, if your syntax mode of choice is not supported (there’s a good chance it may not be) you can post a comment below and let me know about it, I’ll make updates as soon as possible.
You can trigger the plugin by typing your intended comment (single line of text) and choosing Plug-ins > Comment Banner, or simply use the key command from TextMate; Control + Shift + B.
If you’re a Coda user, I hope you find this plugin useful. If you’ve got any feedback at all please take a moment and post in the comment thread, and stay tuned for updates!