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
Thanks for the quick reply, Allan (and sorry for my replying previously without a subject; I am new to the list and this was my first posting).
I tried it, but I must not be putting the disableOutputAutoIndent key in the correct place (I tried several). Below is the contents of my snippet's plist file. Where would I place the disableOutputAutoIndent key code below?
<key>disableOutputAutoIndent</key> <true/>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>content</key> <string><<<EOQ ${0} EOQ; </string> <key>name</key> <string>EOQ (eoq)</string> <key>scope</key> <string>source.php</string> <key>tabTrigger</key> <string>eoq</string> <key>uuid</key> <string>12260674-90D0-426D-84F4-C4F314216C06</string> </dict> </plist>
On 2. Apr 2007, at 06:44, Cliff Joyce wrote:
[...]
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
Thanks for the quick reply, Allan (and sorry for my replying previously without a subject; I am new to the list and this was my first posting).
I tried it, but I must not be putting the disableOutputAutoIndent key in the correct place (I tried several). Below is the contents of my snippet's plist file. Where would I place the disableOutputAutoIndent key code below?
<key>disableOutputAutoIndent</key>
<true/>
Sorry, when using this for snippets, the ‘Output’ part should not be there.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <dict>
So this is what to add, after <dict>:
<key>disableAutoIndent</key> <true/>
On Apr 2, 2007, at 1:11 AM, Allan Odgaard wrote:
<key>disableOutputAutoIndent</key>
<true/>
Sorry, when using this for snippets, the ‘Output’ part should not be there.
Allan, I'm guessing these things will be accessible through the UI in 2.0?
Haris Skiadas Department of Mathematics and Computer Science Hanover College
<key>disableOutputAutoIndent</key>
<true/>
Sorry, when using this for snippets, the ‘Output’ part should not be there.
Worked like a charm. Thanks, Allan!
Allan, I'm guessing these things will be accessible through the UI in 2.0?
I second that feature request. Looking forward to TM 2.0 and Leopard.
BTW, sorry for my emails not threading properly on the ListServe's webpages. I turned off digests and imagine that all will be well now.
--Cliff
On 2. Apr 2007, at 07:24, Charilaos Skiadas wrote:
On Apr 2, 2007, at 1:11 AM, Allan Odgaard wrote:
<key>disableOutputAutoIndent</key>
<true/>
Sorry, when using this for snippets, the ‘Output’ part should not be there.
Allan, I'm guessing these things will be accessible through the UI in 2.0?
The stuff I deem useful enough will get a UI sometime in the future -- I haven’t decided on disableAutoIndent yet ;)