[TxMt] Autoabbreviation?

Allan Odgaard allan at macromates.com
Thu Jun 23 17:23:28 UTC 2005


On 23/06/2005, at 15.21, Ben Jackson wrote:

> Anyone here use or has used TypeIt4Me? I loved the idea while it  
> worked on my machine, but after 5 minutes it disappeared from my  
> menu bar and the developer is not responsive. Basically every time  
> you press a space it scans a list of abbreviations and expands the  
> text if it finds a match. Is this something I could do in tm with a  
> command?

I'd think so. Though more like a macro (bound to space) which first  
selects current word and then runs a command with output set to e.g.  
snippet.

Then that command can look at $TM_CURRENT_WORD and output whatever it  
wants. You'd probably want to set the scope for this macro to “text”  
so it doesn't interfer with your coding.

Though you may also want to look into snippets (with tab triggers),  
although a bit more “manual” in that you need to press tab after the  
abbreviation (instead of space), it's basically the same, though also  
support placeholders and shell runs. For an example try to write:  
“c)” and press tab. For me that expands to: “(c) Copyright 2005 Allan  
Odgaard. All Rights Reserved. ”. For you it should give you your  
name :) You can also do “isoD” for current date in ISO 8601 format,  
or “lorem” for a lot of Latin text. All this is defined in the Bundle  
Editor. The snippets mentioned are in the Text Utilities bundle.  
There are more interesting snippets in the various programming  
language bundles (snippets which e.g. have placeholders you can tab  
through).




More information about the textmate mailing list