I've managed to hose the binding for my keypad Enter key. It doesn't do
anything now. It could have had something to do with using the
'defaults' command, but I'm not sure. Any suggestions? I would even
consider a return to all default keybindings.
ADVthanksANCE!
Regards,
JJ
---
Help everyone. If you can't do that, then at least be nice.
(sorry if this pops up multiple times - gmail doesn't seem to be
working properly)
I've recently started using Textmate and the Latex bundle. I found
that I wanted to extend the functionality in various ways, including
by adding definitions to the Lanuage file to allow me to highlight
footnotes and emphasised text. Some of the code I wanted to add is:
{ name = 'meta.footnote.latex';
begin = '(\\(footnote|noteToSelf)\{)';
end = '(\})';
captures = { 1 = { name = 'keyword.footnote.latex'; }; };
patterns = ( { include = '$self'; } );
contentName = 'variable.parameter.footnote.latex';
},
{ name = 'meta.emph.latex';
begin = '(\\emph\{)';
end = '(\})';
captures = { 1 = { name = 'keyword.emph.latex'; }; };
patterns = ( { include = '$self'; } );
contentName = 'variable.parameter.emph.latex';
},
I've added that code to a copy of the Language definition. It seems
to work fine (there are probably errors, since I'm a newbie) but it
occurs to me that there may be a better way to do it. As it stands,
if the Latex bundle is updated in the next release, I'll still be
using the older language definition. Is there any way I could have
written my snippit to avoid that problem?
Best wishes,
Nicholas
Hi All,
Did I missed a step or something, but the first "child" in a
@media ... {...} never appears color-coded (See the attached
screenshot for an example)
Thanks,
On Jan 29, 2006, at 3:51 PM, Nicholas Cole wrote:
> Just while you are on updating stuff - the various commands from
> the jurabib package are used by many humanities people. There are
> lots of them, so I just match them by extending the pattern
> matching for \cite to match almost anything with 'cite' in it. I
> haven't yet run into problems with that approach...
Hm, that's an interesting idea, just match any command containing the
word cite as meta.cite.latex ..... I'll have to think about that a
bit though, and ask the other maintainers.
Do you have a list of all these commands?
Of course, adding support for every single latex package out there is
not really feasible...
Looking at http://www.jurabib.homelinux.org/jurabib/jb-com-ref.pdf,
there are not really that many citation options, and most of them are
already supported in the newest version of the bundle (in the
repository). What commands do you find missing? I think it is missing
author and title addons at the moment, but those can be easily added.
footcite support was added two days ago or so, along with the new
completion commands.
Haris
Hi Guys,
First time poster, been using TM for a while though.
I'm trying to write a command that will run, do it's thing, then save the
file. The trick is how to get it to save AFTER the command alters the
file. Is this possible?
Specifically, what I am trying to do is update a `Last Modified:` string
whenever I save a file. That's the easy part, I did it with some python
triggered by cmd-s. Now that the string has been altered, how do I save the
file? It seems possible with applescript, but I can't get it to work.
If anyone has any suggestions about this final step, that would be great. I
know there's something wrong with my applescript, it tends to behave
differently in osascript than in Script Editor, is this because of the
escaped quotes? Something to do with combining triple- and single-quotes?
I've searched everywhere, apple documentation, textmate wiki/mailing list,
and turned up nothing! It seems to me that having a "Save After" option for
Commands would be useful. What do you guys think? Maybe this has been
discussed already.
Thanks for your help,
Jim Bagrow
Here is the command:
Save: Current File
Command:
*************************************************************
#!/usr/bin/env python
import os
import re
import datetime
# get selected text from shell:
path = os.getenv('TM_FILEPATH')
f = open(path, 'r')
text = f.read()
f.close()
string = "Last Modified: "+datetime.date.isoformat( datetime.datetime.today()
)
p = re.compile('Last Modified: \d\d\d\d-\d\d-\d\d')
result = p.sub(string, text)
print result
# how can I save the file at this point, AFTER it's been modified?
# PS: I hate applescript!
cmd = """osascript -e \"
set thePath to do shell script \"echo $TM_FILEPATH\"
tell application \"TextMate\"
activate
save current document in thePath
end tell
\"
"""
os.popen(cmd)
*************************************************************
Input: Entire Document
Output: Replace Document
Activation: Key Equivalent -> "cmd-S"
> Have a look at stakeout: http://michael-mccracken.net/blog/
> blosxom.pl/2004/07/28
> This will allow you to have your script notified when the file is
> saved (but not closed, for which there is mate -w).
good tip -- thanks. yes, with a combination like that i can probably
get close to what i was looking for, but i still think that it would
be a lot cleaner for TM to support this more directly.
> As for receiving AppleScript events from a shell tool, that's not
> really possible AFAIK because the sender needs to have the
> receivers four character code, which is something only “real”
> applications have.
right, which is why i was asking for a non-applescript API.
(i think what i'd *really* like is to have a lua interpreter embedded
in TM, but in the absence of that we should be able to do almost
everything with external programs...)
"All that stuff" is required for Rails to run, but you can remove it
from a TM project (which doesn't delete them from the finder) and not
have to deal with files you don't modify.
luke
> From: Alain Ravet <arav2132(a)biz.tiscali.be>
> Date: January 27, 2006 2:04:02 AM CST
> To: textmate(a)lists.macromates.com
> Subject: [TxMt] Re: Req: exclude directory(ies) from "find in
> project".
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> Steve
>
> > Why not just make a project without all that stuff in it and
> just save
> > the project?
>
> Because "all that stuff" is required, of course.
>
> Alain
Thanks to Allen I've managed to add HTML export to my screenwriting
bundle. So now you can export your screenplays in proper Studio
Format! However, thanks to Safari's (and all other browsers) lack of
support for paged-media styles the resulting document does not print
ideally. That being said, it's a very nice result for outputting to
HTML. In fact, it's much better than Final Draft 7! (they don't
declare doctypes... bad final draft). It would be nice to see actual
support of CSS2 paged-media styles... one can only hope.
When exporting a PDF from Safari it adds header information and
footer stuff, as well as a nice .25in margin on every side. I'd like
to change that, if you know how let me know.
I've looked into using HTMLDoc and Prince to export the resulting
HTML document to a pdf by way of bypassing the build-in PDF services
but both of those cost money, something I'd like to avoid. If you
have any tips, let me know.
I've also added support for printing and non-printing comments, as
well as general code clean-up.
Aside from minor changes in regexp rules to account for people's
writing habits, I cannot foresee to many more changes in the bundle
(aside from a better PDF option). So, thanks to all of you who helped
and especially to Allen. You can now say that TextMate has a
(somewhat) full-featured Screenplay-writing bundle that imports
resulting documents *perfectly* into Final Draft. Objective
accomplished.
Download: http://ollieman.net/files/bundles/screenplay.zip
The Diff bundle command 'Selected Files in Project Drawer (HTML)'
references "$TM_BUNDLE_SUPPORT/diff.pl", but the actual file is
"$TM_BUNDLE_SUPPORT/Diff.pl" (note case: d vs. D). If (like in my
case) TM is installed on a case sensitive file system, that command
will not work:
--- Commands/Diff Selected Files.plist (revision 2604)
+++ Commands/Diff Selected Files.plist (working copy)
@@ -11,7 +11,7 @@
exit_show_tool_tip
fi
-perl "$TM_BUNDLE_SUPPORT/diff.pl"
+perl "$TM_BUNDLE_SUPPORT/Diff.pl"
</string>
<key>input</key>
<string>none</string>
Gerd
PS: What are the rules to gain write access to http://macromates.com/
svn?
> I expected to find the header/footer control in Safari 2's File...
> Page Setup..., but eventually caught on to the fact that it is in
> File... Print. Select "Safari" in the third selector and disable
> "Print webpage information in headers and footers". -Jim Tittsler
Good find.
> Not sure what support you seek, but it is possible to give some
> page-break hints with CSS. For example for the TextMate manuals
> print style sheet I force a page break [1] after each chapter. -
> Allen O.
Safari's support for paged-media within CSS2 is limited.
Specifically, it supports both the "auto" and "always" values, but
not "avoid"; which is why I can't get the following rules to work:
@page { size: 8.5in 11in; margin: 1in 1in 1in 1.5in; }
dl, dd { page-break-inside: avoid; }
dt, h2 { page-break-after: avoid; }
h3 { page-break-before: avoid; }
h4 { page-break-after: avoid; }
I've tested these in Safari, Camino, and a Safari Nightly Build.