[TxMt] Move the caret to start of line within a TM snippet?

Charilaos Skiadas skiadas at hanover.edu
Mon Apr 2 03:32:54 UTC 2007


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







More information about the textmate mailing list