Hi. I have the following TM snippet (scope = source.php, tab trigger = eoq):
<<<EOQ ${0} EOQ;
My snippet works fine, except: the trailing EOQ needs to always be placed at the beginning of a line. Currently, the trailing EOQ winds up at the same indent position as the beginning "<<EOQ".
Does someone know of a way to move the caret to the beginning of a line within a snippet? Alternatively, is it possible to call a macro from a snippet? I know I can build a macro that presses the command and left arrow keys, which will move the caret to the beginning of the line.
Thanks in advance. --Cliff
On Apr 1, 2007, at 11:28 PM, Cliff Joyce wrote:
Hi. I have the following TM snippet (scope = source.php, tab trigger = eoq):
<<<EOQ ${0} EOQ;
My snippet works fine, except: the trailing EOQ needs to always be placed at the beginning of a line. Currently, the trailing EOQ winds up at the same indent position as the beginning "<<EOQ".
Does someone know of a way to move the caret to the beginning of a line within a snippet? Alternatively, is it possible to call a macro from a snippet? I know I can build a macro that presses the command and left arrow keys, which will move the caret to the beginning of the line.
Just have a macro that moves you to the beginning of the line and then executes the snippet. Wouldn't that do it? We already do this trick in the Sweave bundle. Then you can have the macro have whatever trigger your snippet was going to have.
Thanks in advance. --Cliff
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 2. Apr 2007, at 05:28, Cliff Joyce wrote:
Hi. I have the following TM snippet (scope = source.php, tab trigger = eoq):
<<<EOQ ${0} EOQ;
My snippet works fine, except: the trailing EOQ needs to always be placed at the beginning of a line. Currently, the trailing EOQ winds up at the same indent position as the beginning "<<EOQ".
Does someone know of a way to move the caret to the beginning of a line within a snippet? [...]
You can have it inserted without the snippet being indented to the current level, the following trick works for tmSnippet files as well: http://lists.macromates.com/pipermail/textmate/2007-March/018523.html