On May 12, 2006, at 4:00 AM, textmate-request(a)lists.macromates.com
wrote:
> I suggest the following:
>
> #!/usr/bin/env python
> import sys, os
>
> oldtask = os.environ['TM_CURRENT_LINE']
> sys.stdout.write("DONE " + oldtask[4:])
>
> -Jacob
Jacob -
Cool! I haven't done much coding lately and I guess it shows.
Thanks for the help.
Mike
On May 12, 2006, at 2:01 AM, textmate-request(a)lists.macromates.com
wrote:
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Linefeeds in commands & snippets
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> This is a Python issue. Python writes a newline to the end of all
> print statements, which is where this is coming from. You could write:
>
> print newtask,
>
> which would not write a newline, but would add a space. In order to
> write -just- the text, this would work:
>
> #!/usr/bin/python
> import os,sys
>
> def texter():
> oldtask = os.environ['TM_CURRENT_LINE']
> # oldtask = "Alligator"
> newtask = "DONE "
> for i in range (len(oldtask)):
> if i > 4:
> newtask = newtask + oldtask[i]
> sys.stdout.write(newtask)
>
> texter()
>
>
> Lindsay
Lindsay -
Thanks for the help, I thought it was something I was doing wrong in
TextMate.
Mike
A while ago, I was try to make a command to add height and width information
to turn a selected word " LBC0001A-1.tif " into code like:
<img src="LBC0001A-1.tif" height="800"/>
"sips", a built in command line tool seems to provide the required
facilities, if anyone is interested in making such a command.
sips -g all /Users/tim/Sites/favicon.png
pixelWidth: 16
pixelHeight: 16
typeIdentifier: public.png
format: png
formatOptions: default
dpiWidth: 95.987
dpiHeight: 95.987
samplesPerPixel: 4
bitsPerSample: 8
hasAlpha: yes
space: RGB
Can also resample and rotate images, etc.
tim
1) The age old problem of tabs versus spaces. Is there a way to have
a command run at file open to convert tabs to spaces or vice-versa?
2) Has anyone put out a bundle to allow hooking into the debugger?
3) Any Zope/Plone bundle in progress? I can't seem to find any.
Thanks.
After using the 'Xcode/Import Frontmost Project' command, for
commands in the newly imported project TM_PROJECT_DIRECTORY is set to
'/'. I think that is an unfortunate choice. If for whatever reason it
can not be set to the 'real' project directory, I think it should
either not be defined at all or empty.
Gerd
I am trying to create a command that will replace text on a line with
new text (actually modified text from the current line). Here is the
code that I am using:
#!/usr/bin/python
import os
def texter():
oldtask = os.environ['TM_CURRENT_LINE']
# oldtask = "Alligator"
newtask = "DONE "
for i in range (len(oldtask)):
if i > 4:
newtask = newtask + oldtask[i]
print newtask
texter()
The problem that I have is that it inserts a line feed at the end of
the new text. Is there a way to prevent that? Thanks.
Mike
Hi,
I recently opened some BibTeX documents in TM (which I normally don't
do since I use BibDesk) and recognized the following problem:
TM tries to fold the BibTeX code, but the end of the BibTeX entries
are not reocgnized correctly.
My entries look like this:
@book{ros:02,
Address = {London},
Author = {Corey Ross},
Title = {The East German Dictatorship. Problems and Perspectives in
the Interpretation of the GDR},
Year = {2002}}
So, the fields are pretty-formatted by BibDesk, they are preceeded by
a tab.
This causes TM not to recognize the end of the entry.
If the entry looks like this:
@book{ros:02,
Address = {London},
Author = {Corey Ross},
Title = {The East German Dictatorship. Problems and Perspectives in
the Interpretation of the GDR},
Year = {2002}}
or like this:
@book{ros:02,
Address = {London},
Author = {Corey Ross},
Title = {The East German Dictatorship. Problems and Perspectives in
the Interpretation of the GDR},
Year = {2002}
}
everything works fine.
Is it possible to change the code folding to work with the first
version?
I suppose many BibTeX users on the Mac will have this problem, since
probably almost all of them work with BibDesk ...
Thanks in advance,
best regards
Matthias
--
Matthias Damm
mad(a)macpla.net
PGP key: http://macpla.net/MatthiasDamm.asc
PGP fingerprint: CED3 6074 7F7D 3148 C6F3 DFF2 05FF 3A0B 0D12 4D41
I always thought this was some simple text-formatting to do list,
much like iCal or any such thing, but it seems to possibly be a code-
centered project something TODO? Is there any way I can get some more
info?
(basicly, I did google a bit and didn't find anything, so I'm looking
for that "you should've found this googling you idiot"-link)
Andreas
Is there a bundle or macro available which would enable me to write
footnotes in plain text/markdown? In markdown there is a footnote
notation for hyperlinks, but I haven't seen any easy way to use it in
Textmate yet. ;)
Dan
On May 10, 2006, at 5:19 PM, textmate-request(a)lists.macromates.com
wrote:
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] What is TODO?
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> On May 10, 2006, at 3:43 PM, Niko Dittmann wrote:
>
>> "todo" searches project-wide for code-comments with the strings
>> "todo", "fixme" and "changeme" and presents a list with the lines
>> and links to the files. very convenient to keep track of...
>> well... things you still have to do. try it!
>
> There is another one called "RADAR". I assume that's some sort of
> bug-tracking tag. Does anyone have more details about it?
>
> Trevor
I have been playing with TODO (actually, I'd like to build a GTD
bundle based on it). For some reason, nothing I label as RADAR shows
up in the TODO list.
Mike
I have read and seen the "edit in TextMate" functionality, but would
rather than having a hack use the Services menu for this. I have also
read that this was a functionality before that was removed. Is it
possible to add that back in easily? Those who don't want to have
this Services menuitem can then use e.g. Service Scrubber (http://
www.petermaurer.de/nasi.php?section=servicescrubber) to remove it.
Or am I missing something here?
-e
--
egil helland / it consultant (mcse, web technology)
web: ikon.as / egil.net mob: +47-91315555
> As a shell script (i.e. just paste in body of command):
>
> echo "Aprox. page #$(( (TM_LINE_NUMBER+37) / 38 ))"
> echo "Aprox. total pages $(( `wc -l` / 38 + 1 ))"
Allan, I could kiss you. But I won't.
A quick addition to the LaTeX Bundle -- there was some mention of
"texdoc" on the TeX on OSX-Mailing list:
Command: "Lookup documentation of current word/package"
Shell script: texdoc $TM_CURRENT_WORD (no input, no output)
Scope: variable.parameter.name.package
with an addition to the language definition: (although I don't know
if the scope names are valid TextMate-speak)
{ name = 'meta.label.package.latex';
begin = '(\\(?:usepackage)\{)';
end = '(\})';
patterns = (
{ name = 'variable.parameter.name.package';
match = '[a-zA-Z,:0-9]+';
}
);
},
This command will then open the corresponding help file for a
selected package.
greets,
Dan
I don't speak any scripting language so I was hoping you all could
help me out with two simple commands.
1. Take the current line number, divide my 38 and display the result
as a tooltip that reads: Aprox. Page-Count for Current Line: XX
2. Take the total number of lines in the document, divide my 38 and
display the result as a tooltip that reads: Aprox. Page-Count for
Document: XX
Thanks in advance!
—oliver
> This should do what you need:
>
> npp=38
> res=$(echo `wc -l`)
> pretty () { rev <<<$1|perl -pe 's/(\d{3})(?=.)/$1,/g'|rev; }
> total=$(pretty $(cut <<<$res -d\ -f1))
> php -r "echo ceil($TM_LINE_NUMBER/$npp).'/'.ceil($total/$npp);"
I get the following error:
> Warning: Wrong parameter count for ceil() in Command line code on line 1 58/
I put together a simple bundle for editing Greasemonkey scripts:
http://adamv.com/dev/textmate/greasemonkey
The page documents the new scopes and snippets.
Not a lot to it, but editing a Greasemonkey script is mostly just
editing Javascript.
I can put it in the repository if anyone else wants to hack on it.
-Adam V.
http://adamv.com
Have you ever wanted to publish your source code with your syntax
highlighting intact? That is, formatted the way that TextMate sees
it? Well, thanks to a recent update to TextMate[1], it's now
possible. I've created two commands that are in the TextMate
subversion repository[2] that are in the Experimental bundle:
Create HTML from Document / Selection:
This command will take your entire document and create a new one
that is an HTML file which recreates the view of your document as
TextMate renders it. It also preserves the colors that you're using
as your current TextMate theme, since it generates the CSS from your
theme file. If you have a selection, this command will only output a
'<pre>' block for that section (instead of generating a full HTML
document plus stylesheet).
Create CSS from Theme:
This command creates a new CSS document that is based on your
current theme.
So, what is this good for? Well, if you want to publish snippets of
code, nicely highlighted, but don't want to create images. Besides,
textual examples are better than images since they're searchable.
So, you could create the CSS rules based on your theme, then add it
to your existing site's stylesheet. Then, you can invoke the "Create
HTML..." command to create the HTML.
Why did I do this? There are many syntax highlighting solutions out
there (indeed, TM itself has a few commands that do this kind of
thing, but they don't reliably reproduce the document the way TM sees
it). But this one leverages the document parsing TM does-- and
therefore, it works with any language definition that is in your
TextMate bundle set. It also doesn't require any additional software
to be installed.
Please report any errors you find to me. And thanks again to Allan
for adding support necessary to do this.
Brad Choate
http://bradchoate.com/
[1] - Release 948's "One can now access the document as parsed by
TextMate." new feature. So these commands require that release or later.
[2] - http://anon:anon@macromates.com/svn/Bundles/trunk/Bundles/
Experimental.tmbundle/Commands/
Eric thanks for the widget. It's great.
I have made a few small changes to the widget.
It perhaps looks slightly better, is resizeable, sorts the projects by name
(ignoring case) and only searches in the users home directory.
It can be found here:
http://email2ants.googlepages.com/TextMateProjects.wdgt.zip
Regards,
Anthony
-----Original Message-----
From: textmate-bounces(a)lists.macromates.com
[mailto:textmate-bounces@lists.macromates.com] On Behalf Of Eric Coleman
Sent: 08 May 2006 15:20
To: TextMate users
Subject: [TxMt] Anyone interested in...
A Dashboard widget that listed your textmate project files? I have a
saved search right now that lists all the textmate project files, and
thought a widget would be nice.
If anyone's interested, I'll toss something together ;)
Regards,
Eric
http://www.theaftermac.com/interview-allan-odgaard/
I still can't your product convinced me to move away from my beloved
Zend Studio. I've used the IDE since they day it came out (until I
discovered TextMate and was blown away)
Eric Coleman
Selecting text from the right to the left, stopping the selection
before the tab trigger does in fact allow for tab triggered snippets
with a selection.
tab_trigger<Selection_end>SELECTED_TEXT<Selection_start>
There are a couple of bad things about this.
There is no way to know how your selection was made, since you can't
see the caret when you have a selection.
That, and the TM_SELECTED_TEXT variable isn't available.
Making the TM_SELECTED_TEXT variable work shouldn't be too difficult
(I would imagine).
But making the caret visible with a selection would really be weird.
I'd still like it, but i may be the only one.
thomas Aylott—subtleGradient—oblivious(a)subtleGradient.com
A Dashboard widget that listed your textmate project files? I have a
saved search right now that lists all the textmate project files, and
thought a widget would be nice.
If anyone's interested, I'll toss something together ;)
Regards,
Eric
Is it possible to have Python fold a complete class
definition, rather than just the "class ..." statement
and the docstring? I looked at the bundle source code,
and I don't know if a regex (or more) can do it. It
seems like a Python parser is needed.
Just curious,
--Dave