How can I escape certain chars in a selection in TM? If this is not built in, can someone help me make a macro or equivalent to do so?
Example: echo "<a href="untitled.html" id="name" class="name" target="_self">test</a>";
I would select the entire line, it would be smart enough to know the language from the string.
echo "<a href="untitled.html" id="name" class="name" target= "_self">test</a>";
I have a feeling there is probably something built in that can help me, but I am just not finding it. -- Scott * If you contact me off list replace talklists@ with scott@ *
On 26 Mar 2009, at 12:38, Scott Haneda wrote:
How can I escape certain chars in a selection in TM? If this is not built in, can someone help me make a macro or equivalent to do so?
If you want to escape " and \ then the steps to record a macro would be:
1. Start Macro Recording 2. Bring up the Find dialog 3. Use ‘[\"]’ as find string and ‘\$0’ as replace string 4. Enable “Regular Expression” 5. Hold option (⌥) and hit “Replace All” 6. Stop Macro Recording
Now save that and give it a key equivalent, possibly also scope it to “source.php” (which is where I assume you want to use this).
Alternatively uou can make a command that takes e.g. “selection or line” as input and replaces selection and the actual command being a simple ruby/perl/sed substitution.