Xcode is a great IDE. Many thanks to the great folks at Apple for turning out just a tremendously wonderful and efficient way to write code.
That being said, I do have a couple of quibbles with it. The completion, while great and very thorough, is often slow and requires navigating a list. For simple snippets, sometimes I’d rather just skip the “pomp and circumstance” and have it just fling some text on the page. This is much in the style of TextMate, another application which I have great love and admiration for.
So far, it’s a one afternoon hack, and it scratches my “itch”. See it in action here in this simple video. It’s BSD licensed and available from github.
Update 1:
After doing a bit more playing with Xcode’s Text Macro system (thanks Gus!), I can see that possible to configure it to be closer to what I wanted. However, some bits are still missing and/or rub me the wrong way.
For example, if one types “pm” (the “#pragma mark completion”) in the file scope, the completion is not suggested until one hits the completion key (usually “Esc”). Another issue is the completely baroque nature of the xctxtmacro file format, especially compared to the ease of writing a TextMate snippet.
As usual, I’m completely open to suggestions on how to improve my Xcode workflow without having to use my unsupported plugin as it’s possible that I’m just missing something.
Update 2:
Doh. Kevin Ballard reminded me about using Ctrl-. to get the first completion out of the list. This goes a long way towards addressing my complaint about immediately getting the first completion available. The only complaint I have left is about the crappy-ness of the xctxtmacro file format and it’s relative lack of documentation.
Update 3:
Added a quick way to add snippets (check the bottom of the Edit menu) and added support for interpolation of the pasteboard’s contents into the snippet.
Explore posts in the same categories: Cocoa, General, Indie Development, OS X