[TxMt] Re: snippet to generate unique ID, detect end of document, and move cursor

Dr. Drang drdrang at gmail.com
Mon Jul 26 00:13:40 UTC 2010


I'll leave the unique ID for someone else to answer. As for the
jumping back and forth in the document, take a look at this:

http://www.leancrew.com/all-this/2006/03/markdown-links-in-textmate-the-final-frontier/

I use reference-style links and put the URLs at the bottom of the
document. You should be able to adapt the logic of my
command/snippet/macro combination to the footnote syntax.

--
Dr. Drang

On Sun, Jul 25, 2010 at 5:20 PM, Stephan Hugel <urschrei at gmail.com> wrote:
> Hello,
> I'm trying to write a snippet that will create a footnote in a TM file
> (using markdown syntax), and I'm having some difficulties:
>
> [snip]
>
> So, what the snippet needs to do (theoretically) when snippet is
> triggered: generate a (not too long, 5 digit alphanumeric should be
> fine for a single document) unique id, and insert the full
> [^footnote_identifier] string, then jump to the end of the document,
> insert [^footnote_identifier]: and a space, allow typing of the
> footnote text, then return to the original insertion point when tab is
> pressed again.



More information about the textmate mailing list