I'm new to TextMate, but after reading James Gray's book, I'm eager to
become a "power user"...
I installed the Perforce bundle (using the GetBundle bundle) and just
tried it for the first time. I selected Perforce->Diff With Base with
a file open that I've already ran `p4 edit` on in the command-line,
and I get:
Perforce client error:
Connect to server failed; check $P4PORT.
TCP connect to perforce failed.
perforce: host unknown.
I double-checked that $P4PORT is set properly, and I can run Perforce
fine from Terminal (and from BBEdit). Do I need to do something else
to setup the bundle? (Is there a way to find documentation for
bundles that I haven't found yet?)
I also noticed that all the key equivalents in the Perforce bundle are
"^$". Is this a sign of some kind of problem?
--
Daryl
Hello. I'm sure the people that set this up have a better
understanding of things than I do, but I'm curious…
Why are all the functions listed in the "Completions" preferences and
listed in the functions.txt file that's used by the "Completions for
Word" command?
Couldn't the Completions preferences be changed to something like this:
{ completionCommand = 'cut -d % -f 1 "$TM_BUNDLE_SUPPORT"/
functions.txt | grep -i "^$TM_CURRENT_WORD"'; }
So the list of functions would only need to be maintained in one place?
FWIW, I tried the above, and `"$TM_BUNDLE_SUPPORT"/functions.txt`
doesn't seem to be pointing the file. I got it to work by giving the
explicit complete path to the file, but that's obviously not what we
want stored in the preferences by default. Could it be that
TM_CURRENT_WORD is defined in the Preferences context, but
TM_BUNDLE_SUPPORT is not?
---
Rob McBroom
<http://www.skurfer.com/>
I didn't "switch" to Apple... my OS did.
>> 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>
Hi,
would it be possible to set a selection in the current document by
using a tmCommand?
Example:
('|' is indicating the caret position)
-This is a te|xt line.
I invoke a tmCommand which calculates the starting point of a
selection, and it sets the selection to e.g.
('[' and ']' indicate the selection)
-This [is a te]xt line.
Thanks!
Best,
Hans
> 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, Charilaos (cool idea). Unfortunately, this won't work well
in my situation because the point of the snippet is to assign some
HTML text to a PHP variable, like this:
$myVar = <<<EOQ
<table cellspacing="0" cellpadding="0" border="0">
<tr align="left" valign="middle">
<td>
Data
</td>
</tr>
</table>
EOQ;
The macro would place the caret to the left of the indented $myVar
string, then run my snippet (which would not work properly).
Allan's solution looks promising, but I cannot figure out where the
place this key in the snippet's plist file:
<key>disableOutputAutoIndent</key>
<true/>
--Cliff
>> 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.
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?
<?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>
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
Hi,
is there any difference to insert something as snippet by using a
normal tmSnippet and tmCommand which is set to the output 'Insert as
Snippet' and input 'selected text or line'?
My problem:
I have a document containing the line:
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/
1/'` ;
At the end of that line I'd like to insert a snippet '${1:Hallo}
World'. If I do it via a tmSnippet it works perfectly. But if I write
a tmCommand à la:
Command:
in=$(cat)
caret=$TM_COLUMN_NUMBER-1
lnhead=${in:0:$caret}
lnend=${in:$caret}
echo -en "$lnhead\${1:Hallo}World$lnend"
Output: Insert as Snippet
Input: sel. text or line
it crashes, meaning TM inserts: 'build_cpu= ; HalloWorld'.
Maybe TM has some problems while parsing the line? But as tmSnippet
it works?
If you change the output to 'Show as Tooltip' the command did the job
correctly. I only can guess that if in the line occurs a '$' TM will
have problems. And if this is true, what can I do? I already tried to
escape all '$' in the variable 'in' but no success.
Any hint would be very helpful. The example as tmCommand I attached
to this mail.
Thanks,
Hans