> 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
Hi.
I'm having some problems with textmate jumping in the encoding. I
have e.g. a website which is saved in iso-8859-1 and correctly opened
in the same format.
I then have some text from a word file that i copy. This text is in
danish, so it have some of the danish letters (æøå).
When I paste this into the before mentioned document in Textmate, the
whole document changes to UTF-8. Because of this when I save it and
upload it, all the dansih letters becomes garbage text (because it
tries to open it as a iso-8859-1 as I have specified).
The same thing happens in Textmate if i try reopen it as iso-8859-1
But is there any reason for Textmate to change the encoding of the
document just because I paste some text, and can I avoid it ?
Regards
Danny Krøger
Hi,
I have a tiny suggestion.
For me it is often the case that I have to replace, let's say hex
\x0B (TAB INDENTION), with '\n'. If I do it using TM's Find/Replace
dialog it takes several minutes for a file with 400 lines and, let's
say 4000 occurrences of '\x0B'. Furthermore TM occupies a lot of my
CPUs.
If I do the same by using the 'Filter-Command' with e.g. 'perl -npe s/
\x0B/\n/g' it only takes a few seconds.
I could image that the speed problem arises if the Find/Replace
routine has to insert '\n'.
Would it make sense to include an option or button within the Find/
Replace dialog, like 'External Replace All' or whatever, to call an
external maybe perl/sed/ruby routine to do the job, esp. if I want to
insert many NEW LINES?
I don't know what kind of disadvantages it would have.
Of course, one could write a tmCommand with a dialog to do it (or
using the Filter command), but in order to avoid additional typing I
would suggest to include such a functionality within TM's Find/
Replace dialog. Esp. for users who don't know the syntax to write
such a regular expression would it be helpful, I think.
Cheers,
Hans
Howdy.
I know this has been covered before.
But…
Has anyone figured out a way to make the gear menu work and have
Apple Remote Desktop installed at the same time?
I'm SO sick of the gear menu shortcut being useless on all of my
machines.
⌘⌃t is lovely, but doesn't replace the wonderful gear menu.
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
I want to contribute some patches to the Perforce bundle, but I need
to clear up some confusion first...
http://macromates.com/wiki/Bundles/HowToContribute tells me to start
by checking out the latest version into ~/Library/Application
Support/TextMate/Bundles. (That's where the Perforce bundle is now,
which I downloaded using the GetBundle bundle.)
But http://macromates.com/textmate/manual/bundles#installing_a_bundle
tells me to create /Library/Application\ Support/TextMate/Bundles/ and
install them there.
Then I'm further confused by the following in
http://macromates.com/wiki/Bundles/HowToContribute:
> Normally it is not recommended that you checkout bundles to the above
> location [~/Library/..., I guess], because when you change the bundle
> items from inside TextMate, it saves changes to ~/Library/…,
> potentially leading to merge conflicts if the files are updated in an
> incompatible way on the server.
>
> If you already have done a full checkout of the repository to /Library
> then you can instead do a symbolic link...
So what should I do? Should I check out the Perforce bundle to
/Library/... or ~/Library/...? Should I ignore the instructions to
create a symbolic link, since I haven't done a full checkout to
/Library/...?
--
Daryl Spitzer
Hi,
in my bundle, there are several hundred snippets. Is there any secret
how I can make these dissapear from the menu at the bottom line of the
window, left to the one with 'tab size: '? I'd like to list the
interesting ones only.
Patrick
I'm running the cutting edge (1372) TextMate, with an unmodified Markdown
bundle, and the Links submenu in the bundle menu does not have any items; it
doesn't even open.
This is true regardless of the mode of the file I'm in, and regardless of
what (if anything) I have selected.
Is this a known regression?
--
Chris R.
======
Not to be taken literally, internally, or seriously.
I've noticed a little typo (i think) in the TODO bundle
It's in the CHANGED part.
It wasn't case sensitive and after a quick look i saw
{ :label => "CHANGED", :color => "#008000", :regexp => /CHANGED
[\s,:]+(\S.*)$/i },
the "i" was missing and the end of the regex
Maybe it was done on purpose .. then i didn't say anything
Regards J.
Hi all.
First post here. I am testing Textmate on our Macpro (Quad 2.66GHz, 4Gb) and
we have tried
to load a big file (~300Mb) without success. We got the "Out of memory"
message after a
few seconds. Is there a size limit for file sizes in textmate ?
I understand most users would not have to handle big files but sometimes
this happens here.
Thxs,
Sergio
_________________________________________________________________
Its tax season, make sure to follow these few simple tips
http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.…
With Version 1.5.5 (1372) and recent svn bundle updates, suddenly
Objc-C syntax coloring has become very slow, sometimes lags like 2
seconds on a larger file. There never was any noticeable delay
previously with those same files. What changed?
Gerd
I've tried to make the citation and bibliography commands detect
where your installation is, so that you shouldn't have to set any
environment variables for those any more. So once again, those brave
among you and with no paper deadlines, please remove any special PATH
specifications that you had made just for LaTeX TM (likely based on
previous recommendations by me), and let me know if the commands
still work for you, and if not then also where, to the best of your
knowledge, your tex binaries are. (Probably doing: "which kpsewhich"
from the terminal should give that to you.
Thank you all again for your patience in this transitive period.
Haris
Hellou all,
i'm just new to textmate and I want to make me own templates
for .pl, .fcgi etc. I just checkout Bundle from svn and I create these:
[milan@krachsna]-[/Library/Application Support/TextMate/Bundles]# ls -
la Perl.tmbundle/Templates/Perl\ Script/
total 8
drwxr-xr-x 4 milan admin - 136 Mar 31 10:10 ./
drwxr-xr-x 4 milan admin - 136 Mar 31 10:09 ../
-rw-r--r-- 1 milan admin - 117 Mar 31 10:10 index.pl
-rw-r--r-- 1 milan admin - 660 Mar 31 10:10 info.plist
but no result in Menu->New from template->Perl the Perl is still missing
Can somebody help me how to do this.
thx a lot
--
Toth Milan
milan(a)toth-online.com
http://toth-online.com
Hi there,
I'm fairly new to TextMate and this list has been quite helpful.
Hopefully we'll be receiving my copy of the TextMate book today.
Thanks James!
I do a fair amount of writing in both DokuWiki and WikkaWiki. The
DokuWiki bundle is quite handy but I would also like to use it as a
basis for a WikkaWiki (WikiEdit) bundle. There not major differences
but both syntaxes would be nice. I couldn't quite make out in the
manual the best way to go about this. I can make a copy of the bundle
package but then what?
Thanks in advance for any help,
Ron
*******************************************************
* Ron Patterson, Email: rpatter(a)asd20.org *
* Web Services, Phone: 719.234.1707 *
* Academy School District 20, FAX: 719.234.1706 *
* Web Site: http://www.asd20.org *
*******************************************************
I have been a long time emacs user and recently discovered TextMate.
One of the things I am missing is a "convenient" code navigation tool,
a la cscope (find from where a function is called, where the
definition of a function is, ...)
Maybe there is a built-in/standard way for doing such a thing in
TextMate, but didn't find it.
I just wrote the first version of a Cscope bundle that :
1. automatically builds a cscope index for files in a project
(including projects imported from Xcode) ;
2. allows to find from where a function is called (mapped to Ctrl-C)
3. allows to find where a function is defined (Ctrl-F)
Since I am very new to TextMate, I am sure I broke some conventions:
comments / ideas for enhancements are welcome.
You can download it from here:
http://www.box.net/shared/lt1u4tiuj7
Thanks,
Sacha
On 3/29/07, Ollivier Robert <roberto+textmate(a)keltia.freenix.fr> wrote:
> That's what revision control is all about you know :)
>
> I do the same with RadiantCMS, ruby 1.9 and a bunch of other utilities. My
> VCS of choice is Mercurial (http://selenic.com/mercurial) but that should
> not matter much :)
Since you bring it up - what VCS are people using on OS X? Is there
anything that integrates nicely with TM?
I posted the following to MacResearch, with no luck, but I'm hoping
there are some Textmate users that might be able to help me:
Does anyone have any experience sending data to Igor Pro from python?
I'm looking for a way to interface python to Igor Pro. I am using
TextMate to write python code that writes a data file. I manually
open the file with Igor Pro, set up a plot and then, when I re-run
the python script to make a different data file, I want to send an
instruction from python to igor to reload a data file, and that way
Igor will automatically
replot a graph. Apparently one can control Igor Pro via applescript
(which I haven't learned yet), and there is a python package called
appscript (http://appscript.sourceforge.net/) that can mimic
applescript. So,
1) does anyone have a sample applescript that can tell Igor Pro to
load a data file?
2) does anyone have an "appscript" (http://
appscript.sourceforge.net/) that would achieve the same end?
-paul
________________________________
Dept. of Physics
University of Southern Maine
http://www.usm.maine.edu/~pauln
Hello,
is it possible to insert a ctrl-L (new page) into the current buffer?
And is it possible to make this visible? And can I even use some key
to behave as 'go to the next/previous page'?
Patrick
Hi All,
There are quite a few blog experienced folks here so I hope you
excuse the OTness:
Recently Wordpress has been buffing me: Security issues requiring
immediate updates, too much manual labor for updates (especially if
you maintain multiple blogs for multiple users on your linux server),
upsurge of spam that can't even be stopped by disabling comments...
Are there alternatives that address the above issues?
Thanks
Gerd
I'm working on a Latex document that uses a lot of complex sub- and
superscripts,
so I wrote a little snippet
_{$1}
which is activated by the underscore key (and the corresponding thing for ^,
of course).
I use this a *lot*, and it has saved my brain a lot of confusion, and my
right little finger
a lot of wear and tear. But it also has a benefit that I wasn't expecting:
when I've finished
typing the subscript, I can just press tab to escape from the braces, and
continue with
the rest of the expression.
I find that invaluable, and I've started to get frustrated that the same
thing doesn't work
with ordinary auto-completed braces, parentheses, etc. Of course I could
write a snippet
{${1:$TM_SELECTED_TEXT}}
and bind it to the { key, but then you don't get the nice feature that
deleting the opening
brace will delete the closer as well. It would be nice to have the best of
both worlds. How
about making it possible to tab out of *all* auto-paired thingies, in the
way that you can
from a snippet?
Robin
TeX flags errors by a line that starts with "! "; but the LaTeX Log format
doesn't treat them as anything special so there's no way to make them stand
out. Could we change the invalid.illegal definition to the following
{ name = 'invalid.illegal';
match = '.*Error|^! .*';
},
or something along those lines? And while I'm on the subject, the
firstLineMatch seems rather restrictive. Could it be generalised to:
firstLineMatch = 'This is (pdfe)?TeXk?, Version ';
since not everyone uses non-standard extensions (the 'k' suffix) nor even
PDFTeX?
Robin
Hi,
I'd like to put my ruby/shell scripts for my bundle on the harddrive.
Where should I store them? I'd like to have a place like
mybundle.tmbundle/bin
But then how would I access the script? Any pre-defined variable for
that location, such as $TM_CURRENT_BUNDLE?
Patrick