[TxMt] Re: Snippet replacing word before

René Schwaiger sanssecours at f-m.fm
Wed Oct 28 16:51:26 UTC 2015


Hi,

> On 28 Oct 2015, at 16:03 , dangerwillrobinsondanger at gmail.com wrote:
> 
> I want to make my snippet replace the word before the caret. 
> Using TM vars I can insert that word in the right place in the snippet but the snippet always shows up immediately after the word. That is the original word is still there in the original location. What am I missing ?

as far as I understand, you just want to replace some (constant) piece of text with another (constant) piece of text? For that purpose you do not need to use any environment variables at all. For example, to replace an occurrence of the text `->` by the character `→` after you pressed `⇥`:

1. Open the bundle editor (`^` + `⌥` + `⌘` + `B`)
2. Create a new snippet (`⌘` + `N`)
3. Enter the text `→` (without the back-ticks) in the editor part of the bundle editor
4. Set the tab trigger to the text `->`

I included a screenshot of the snippet mentioned above.

Kind regards,
  René

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20151028/d4942248/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2015-10-28 at 17.33.59 .png
Type: image/png
Size: 199256 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20151028/d4942248/attachment-0001.png>


More information about the textmate mailing list