[TxMt] Re: suggestion

Allan Odgaard mailinglist at textmate.org
Thu Dec 5 06:50:03 UTC 2013


On 5 Dec 2013, at 13:05, Yvon Thoraval wrote:

> suppose i want to report a variable state in NodeJS and/or JavaScript, 
> for
> example:
>
> console.log("myvar['"+property+"'] = "+myvar[property]);
> […]
> could that last step be implemanted in TextMate ?

Given your steps I would suggest creating a new snippet that is:

     "+${TM_SELECTED_TEXT}+"

Then set the scope selector to:

     source.js string & dyn.selection

And set the key equivalent to ".

This way, when you have a selection in a (JavaScript) string and press " 
then it wraps it in the proper string append syntax. In all other 
contexts, the double-quote key works as default.


More information about the textmate mailing list