Text Expander

When I’m developing on my desktop, I always use a text expander to output fancy comment blocks, date/time stamps, dummy text, etc. It would be cool to see this functionality added to Codea, like an option panel where you can specify:

  • Label (“Dummy Text”)
  • Output (“Lorem Ipsum…”)
  • Shortcut (“lorem”)

I haven’t taken a look at the repository yet, so maybe this is something I could actually do myself. If it’s not really important to others, I could take this on myself, as it’s something my OCD relies on. Would be a good way to familiarize myself with Codea, anyways.

It’s something I’d like to add — though I am thinking more along the lines of Xcode’s tokens (tokens are expressed <#TokenName#> but visually displayed as graphical tags).

So then you would construct your snippets using tokens, and insert them into Codea (Edit: insert them from some sort of snippet menu). You might even have ones that reference metadata.

E.g. Here’s how I was thinking to define a snippet to insert a method in the current class. The CurrentTab token could automatically take the name of the active tab. And the InsertionPoint token could indicate where the text caret would be placed after the snippet is inserted.


function <#CurrentTab#>:<#MethodName#>( <#InsertionPoint#> )
    <#Code#>
end

I think some details still need to be ironed out before I look at implementing this, though.