[TxMt] Creating temporary snippets....

Brian Huddleston binarynomad at gmail.com
Tue Oct 16 18:09:04 UTC 2007


I tend to use snippets a lot in textmate because they help me  
standardize my data (text files, reports, blogs, wiki pages, code,  
etc).  I wanted to know if there was anyway (or any planned features)  
that would allow the use of a temporary snippet, so that someone can:

	1. while working in a file goto a blank line
	2. type in some snippet code
	3. highlight the code
	4. hit a key combo to copy the snippet into a temp register/key that  
can then instantly be used in the document.

For example, say I'm writing a document that has is starting to use a  
bunch of citations:
"Begin with the name of the author, moderator, or other responsible  
person or organization, if available, followed by the date of  
publication, the title of the site, the URL, and the date of access.   
(ex: American Chemical Society.  (2006).  Chemistry.org.  http:// 
www.chemistry.org/portal/a/c/s/1/home.html  (24 Mar. 2006).)"

So on a blank line I type:

	$1. ($2). $3. http://$4 ($5).

I then select the text, and copy it to a temp register[1], (perhaps  
with a fixed tab trigger, or hot key) and now I can quickly call on  
it to populate the rest of my document.

This would save me time without having to goto snippets, create a new  
snippet, assign a name, key combo, code, etc, then use the snippet,  
and after I'm done with the document, go back in and delete the snippet.

I find I love the use of the snippets, but sometimes a formating  
issue is only needed once, not enough to warrant creating permanent  
snippets.


[1]: If there were 3-4 registers, then that would be even better.

----
Brian H
binarynomad at gmail.com
http://www.binarynomad.com




More information about the textmate mailing list