The -w wait mode now switches back to the Terminal program upon
window close. You can set which program (or no switching) by editing
the OPENTERMAPP variable. E.g. I have it set to iTerm, because I like
it better!
http://macromates.com/svn/Bundles/trunk/Scripts/tm
- Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
Okay, somebody had the brilliant and easy idea of adding a little
'Hit RETURN' kludge to allow use of TM with svn and other external
editing. So I tweaked the command line tool I posted and added a
better help listing and a -w to have it block until the user hits
RETURN.
I have used it successfully to check it into SVN and use TM to write
the comment. The little pleasures! :)
You can get it at
<http://macromates.com/svn/Bundles/trunk/Scripts/tm>. If you need
this tool, you don't need my help installing it...
best, Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
1. I have appended a shell script that launches TM and allows piped
input. I did not write the script; in fact, I merely found it in my
~/bin directory and thought that it came with the standard TM
install. The -c option lets you create a new file.
It does lack the crucial 'don't quit until editing is done' feature.
Here are three kludges I can think of to get that feature. Given a
-wait flag:
a. add a block at the end of the script that creates a $TM_FILE.lock
in the same directory and checks every N seconds for the .lock file.
When it's gone, quit the script. Then create a command that saves
current file and deletes the .lock file. Finally, write a little
macro that saves, closes the window and runs the 'delete .lock'
command.
In a future version of TM that triggers scripts/commands on events,
one can avoid the command and macro, and have 'Close Window' trigger
the deletion of the lock file.
b. have the shell script loop and check for changes to the
modification date on the file. Unfortunately, that means it will quit
on the first save. But you don't need any fiddling with macros and
commands.
c. call the Textmate Service from a (different) shell script. The TM
Service definitely blocks whatever app calls it. In other contexts
this might be a bug, but here it's great. However, I don't know how
to pipe text to a Cocoa Service from the command line. This may be
rather hard. Any ideas?
- Eric
---
#!/bin/sh
# Originally written by Rick Gardner (rick.gardner(a)mac.com)
# and Kevin Ballard (kevin(a)sb.org)
# Modified to work with TextMate by Andrew Ellis aellis(a)gmx.net
# 10-11-2004
OPEN="open -a TextMate"
CREATE="touch"
USAGE="usage: tm [-ch] filename [filename ...]"
CREATE_FILE=0
while getopts ch FLAG; do
case $FLAG in
c) CREATE_FILE=1;;
h|\?) echo $USAGE; exit 1;;
esac
done
shift $(($OPTIND - 1))
# are we dealing with a filename or are we using stdin?
if (( $# == 0 )); then
if [ ! -t 0 ]; then
exec 6<&0
exec 7>&1
prefix=/tmp/tm
suffix=$(date +%s) # The "+%s" option to 'date' is
GNU-specific.
filename=$prefix.$suffix
$CREATE $filename
exec > $filename
while read a1
do
echo $a1
done
open -a TextMate.app $filename
exec 0<&6 6<&-
exec 1<&7 7<&-
else
if [ ! -z ${1} ]; then
$CREATE ${1}
$OPEN ${1}
else
$OPEN
fi
fi
else
# iterate over the files
for filename; do
# create the file if requested
if (( $CREATE_FILE )); then
if [[ -f $filename ]]; then
echo "File \`$filename' already exists."
fi
$CREATE $filename
fi
if [[ -e $filename ]]; then # now also
opens directories
$OPEN "$filename"
else
echo "File \`$filename' does not exist."
fi
done
fi
Hi guys,
is there a way to split a page in 2 views? Nice, when working with a
lot of properties in a class. So I
can have all the properties show up in one view, while working on other
parts in the class. It would
also be nice to have a split view with two different files. Like
classfile1 on top and classfile2 on the
bottom.
Best Regards,
Andy
Hi
Is there any way, or will there be, to browse the files from the HD?
Like as in the projects drawer, except - being able to browse your HD. I
was a long time user of jEdit and found this option most useful.
Thank you
Eoghan
This gets more interesting once we have a way to direct HTML to the
preview window. Another thing that would be nice: command execution
from URLs, which would allow the references to other man pages to work.
But there are -- of course -- security implications to that feature.
Perhaps if it only works in the preview window, not system-wide.
ruby -e "
def error( message )
%x{osascript <<END
tell application \"SystemUIServer\"
activate
display dialog \"#{message}\"
end tell
END
}
end
def ask(question, answer = '$TM_SELECTED_TEXT')
%x{osascript <<END
tell application \"SystemUIServer\"
activate
display dialog \"#{question}\" default answer \"#{answer}\"
set answername to text returned of the result
do shell script (\"/bin/echo \" & answername)
end tell
END}
end
error('Xcode tools must be installed to view man pages') if not
File.exist?('/Library/Application Support/Apple/Developer
Tools/Plug-ins/DocViewerPlugIn.xcplugin/Contents/Resources/rman')
name = ask('Display man page for which command?')
name.chomp!
temptemp = %Q{/tmp/tmp.#{name}.`whoami`.TMmantemp}
temphtml = %Q{/tmp/tmp.#{name}.`whoami`.html}
%x{man #{name} > #{temptemp}}
# generate HTML and open it if successfully found the entry
if not \$?.success? then
# puts 'No manual entry for ' + name
%x{open -a TextMate &} # switch back to TextMate
else
%x{cat #{temptemp} | \"/Library/Application Support/Apple/Developer
Tools/Plug-ins/DocViewerPlugIn.xcplugin/Contents/Resources/rman\"
-fHTML > #{temphtml}}
%x{open #{temphtml}}
end
"
On Jan 13, 2005, Allan Odgaard wrote:
> It's really difficult to say. I have a few things that needs to be
> done before I will go into the input stuff, and these are already
> taking far longer than predicted. And the fix itself I am not sure
> either how long will take -- the best I can do is probably to say,
> don't expect it before at least in 4-6 weeks.
Thanks for your candid reply. I'll work around the problem and look
forward to the fix.
Jonathon
Hi, I'm currently rewritiing the php code completion thingy, and I'd
like it to be scope sensitive.
To find the scope at the cursor I can use the file as stdin, and work
it out myself. But it struck me that I'd be able to work some things
out based on the current pattern applications (like 'Embedded PHP',
and being in quotes). So a couple of questions.
* could we have a variable $TM_PATTERN_NAME which gives the current
pattern name?
* would there be a way to access patterns names 'higher up'? (like
'Embedded PHP')?
I'm wanting to figure out the scope because I'm implementing scope
sensitive completion, including completions based on your own code.
Any comments, advice, much appreciated.
Ian White
Having just returned to the Macintosh after eight years of using
Windows (and TextPad), one of the first applications I installed was
TextMate. Twenty minutes later, when I'd piped my first text through
markdown.pl and created my first tab-activated snippets, I was already
happy to pay the license fee.
However, I then found it wasn't possible to enter Japanese text. The
list archives revealed that Kazuo Saito had already raised this issue
(http://one.textdrive.com/pipermail/textmate/2004-December/001824.html)
and that Allan Odgaard had promised a fix:
> I can't give an ETA on when this will be fixed, but I can imagine it's
> frustrating for those who rely on these input methods, so I'll try not
> to have “the fix” pending for too long.
I appreciate that perhaps only a tiny minority of TextMate users need
to work with Asian languages but was hoping that it might be possible
to give an approximate ETA on when this will be fixed. I really don't
want to waste time looking for an alternative to TextMate.
Thanks,
Jonathon Delacour
Just something I ran into today, which I just assumed to be there until I
wanted to use it: search direction option :)
Jeroen.
--
"We apologize for the inconvenience"
Emulate the CodeWarrior/Xcode Open Quickly feature, but open all
matches instead of just the first one. (NSAttributedString, I'm looking
at you.)
####
find /usr/include
/System/Library/Frameworks/ApplicationServices.framework
/System/Library/Frameworks/AppKit.framework
/System/Library/Frameworks/Foundation.framework
/System/Library/Frameworks/Kernel.framework -name `osascript -e "tell
application \"SystemUIServer\"
activate
display dialog \"Find and open which header?\" default answer
\"$TM_SELECTED_TEXT\"
set headername to text returned of the result
do shell script (\"/bin/echo \" & headername & \"*\")
end tell"` -print -exec open -a TextMate {} \; &
####
A refined version of this may show up in the C bundle soon. Meanwhile,
feedback is welcome.
Have fun,
Chris
hi,
some people on the list talked about the icon and it seemed they
didn't like it very much. i dont hate the old icon but it also doesnt
impress me every time i see it, so over the weekend i had too much
freetime and fired up inkscape to play around a bit. here is the
result, i would like to hear some opinions how you like it or not.
its inspired a bit by subethaedits icon and by the color-circle one
posted here on the list and so i filled it purple to fit the gap. :)
--
Torsten Becker
Hi,
I'm new to the list, so please forgive me, if this has being asked
before.
Is it possible to change the tab behavior of TextMate? For example I
find
it strange that single line intending to the right works correctly
(using tabs),
but if you try to tab back to the left site, it is using spaces instead
of tabs.
It would also be great to change the behavior of multi line tabbing.
I'm so used to use the
tab key to intend to the right and "apple key" together with the tab
key to move lines to the
left. But if I do that, the lines I would like to intend, are deleted.
(I hope you understand what I mean.. sorry for my english)
Other then that I really like TextMate.
Kind Regards,
Andy
Switzerland
hi folks,
Another tip I thought I'd share. I often have situations where I
have to discard all lines in a file that start with a number, or
other cleanup tasks like that. Now, you can use TM's Text>Filter
Through Command... and then use grep or grep -v. But I have a hard
time remembering grep's regexp format. It's already all I can do to
remember TM's and Perl's.
So I wanted to write a command to pop up a GUI input field so I could
enter in a Perl regexp for lines to match with two buttons so I could
either Keep only the matching lines or Discard the matching lines.
So what I did was toss together a quick script in Perl and use
CocoaDialog as a front-end. To use this, you need to download
CocoaDialog from <http://cocoadialog.sourceforge.net/download.html>,
and put it in /Applications. (If you don't like that place, change
the path in the script.)
If you don't have a need for this script, you still might be able to
get some mileage out of CocoaDialog. It is a simple way to get GUI
onto any script that talks to the command-line. It has a number of
different window formats. Pashua is neat, but it requires use-ing a
module, and Platypus is more for creating drag-and-drop things.
good luck, Eric
---
TM Command.
Before: nothing
Command:
my$CD="/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog";my$rv=`$CD
inputbox --title "Filter with Regexp" --no-newline \\
--informative-text "Filter lines matching this Perl regular
expression:" \\ --text "" \\ --button1 "Keep" --button2
"Discard" \\ --width
500`;my($button_rv,$term)=split/\n/,$rv,2;while(<STDIN>){if($button_rv==2){unless(/$term/){print;}}elsif($button_rv==1){if(/$term/){print;}}}
Stdin: selected
Stdout: replace selected
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
howdy,
there is an option to 'Highlight Current Line' in the preferences; is
there anyway to control the color of that line? maybe through the
syntax highlighting files? thanx in advance...
- jamal
I posted another set of icons to the wiki today, but I'll announce it
here. They are more in line (I think) with aqua-style editor icons
(pages and pen), and they use a lot of ideas garnered from the list
archives. There are six colors in the disk image, so hopefully you will
find one you like, and they all have been designed to degrade
gracefully (48 is less detailed so it's not burry and 32 and 16 are
even more so). I would appreciate any feedback/comments etc.
preview: http://www.eight7.com/repository/tmicon_preview.png
icons: http://www.eight7.com/repository/tmicons.dmg.gz
Thanks all!
Jonathan Raphaelson
University of Colorado at Boulder
--
Home: 303-469-3442
Cell: 720-937-4372
jonathan.raphaelson(a)colorado.edu
jonraphaelson(a)gmail.com
>If using LaTeXTidy.pl and your LaTex Tidy bundle command, were should
>LaTeXTidy.pl be placed. I tried usr/local/bin but that did not work.
>Should I place it inside the bundle itself.
First, make sure it's set to execute (chmod +x LaTeXTidy.pl). Then
either place it in your PATH and call it as LaTeXTidy.pl or put it
somewhere you like, e.g. /usr/local/bin/LaTeXTidy.pl and call it with
its full path in the command. I hope that works!
If you put it in the same bundle as the command, then call it with
wither the full path if you know it, or with
"$TM_BUNDLE_PATH"/LaTeXTidy.pl if you think you might move it someday.
Good luck, Eric
ps. Backup your documents! Check! This works for me, but you should
be cautious.
I'd like to play around a bit with an alternative light-on-dark color
scheme for my bundles, but, in the same way that I can't draw a
straight line with a ruler (but can appreciate architecture) I am
completely inept at picking text colors that have high contrast and
look good (but I know them when I see them).
I know someone (or someones) whipped up a C bundle with a light-on-dark
scheme, but I can't seem to find it anywhere. I thought I might start
by looking at that, but what might be better is if someone could point
me to a resource that had examples of high-contrast color schemes for
text highlighting. :-)
Anyone?
Thanks,
B
--
__ ____
/ / / __/ Brian Lalor
/ _ \/__ \ blalor(a)bravo5.org
/_.__/____/ http://bravo5.org/
Here is a little command I've written (as usual, a wrapper around a
Perl script), which naively tries to indent your LaTeX file
intelligently. If it succeeds, there are two good side effects.
First, your file looks nicer. Second, your file foldings work
correctly, as TM is cued by the indentation.
Good luck. Check the file, if you use it. It works for me, your
mileage may vary.
I've appended the one-liner version. Since it is a blob of line
noise, I also have a link to the latest version of the uncompressed
Perl, which is at
<http://anon:anon@macromates.com/svn/Bundles/trunk/Latex.tmbundle/LaTeXTidy.…>
You can put that somewhere and write a command to call it instead.
I suspect anyone with issues with the folding could customize this
script for their language if necessary. I know PerlTidy and HTMLTidy
exist. I couldn't find a TeXTidy, so I wrote this last year...
- Eric
--
Before: Nothing
STDIN: Entire
STDOUT: Replace doc
Command:
perl -e 'my$in;while(<STDIN>){$in.=$_;}my@keywords=qw( appendix
author bibliography bigskip chapter date def document
evensidemargin font headheight headsep include index make new
noindent oddsidemargin page paragraph part ragged renew
section subsection subsubsection subsubsubsection table
textheight textwidth title topmargin use
vfil);$in=~s/\%(.*?)\n/\n\n\%$1\n\n/g;my@pieces=split(/\n\s*\n/,$in);my$string,$keyword;foreach(@pieces){if(/^\s*\%/){$string.=$_."\n";next;}s/\s+/
/g;foreach$keyword(@keywords){s/(\\$keyword)/\n$1/g;}s/([^\\]\%)/\n$1/g;s/(\\begin\{)(.*?)(\})/\n$1$2$3\n/g;s/(\\end\{)(.*?)(\})/\n$1$2$3\n/g;s/(\\item)(.*?)(\\item)/$1$2\n$3/g;s/(\\item)/\n$1/g;s/[^\\](\\\[)/\n$1/g;s/(\\\])/$1\n/g;s/(\\\\)\s/$1\n/g;s/(\\\\\[)(.*?)(\])\s/$1$2$3\n/g;s/\n\s*\n/\n/g;s/^\n//;chomp;$string.=$_."\n\n";}$string=~s/\n\s+\n/\n\n/g;$string=~s/(\%[^\n]*)(\\)(end)/$1$2\{\n\n\n\}$3/g;$string=~s/(\%[^\n]*)(\\)(begin)/$1$2\{\n\n\n\}$3/g;$string=~s/(\\end)/\[\n\n\n\]$1/g;$string=~s/(\\begin)/\[\n\n\n\]$1/g;@pieces=split(/\[\n\n\n\]/,$string);my$indent=1;my@lines;my$piece,$i;$string="";foreach$piece((a)pieces){$piece=~s/\{\n\n\n\}//g;$piece=~/^\\(.*?)\{/;if(lc($1)eq"begin"){$indent++;}else{$indent--;}@lines=split(/\n/,$piece);foreach(@lines){s/^\s+//;if(/^\\begin/i){for($i=1;$i<=$indent-1;$i++){$string.="\t";}}else{for($i=1;$i<=$indent;$i++){$string.="\t";}}$string.=$_."\n";}}print$string;'
I love the new mode-based menu interface for macros/snippets/commands.
What I'd really love is if I could control which mode menu they show
up in.
For example, I've made a couple of commands that are related to HTML.
However, since I've made them myself, they show up under the "Custom"
menu, when I'd really like them to be under "HTML". Maybe, like with
the syntax files, a "mode" key could be added to the
macros/snippets/commands plist files where I could specify which mode
they should be a part of?
What do you think? Thanks much.
Wow--I use TextPad daily on my PC at work and always wished there was a
text editor like it for the Mac where I could easily switch between
documents with tabs. And the ability to call a shell script to do a
word count or any other UNIX command and have the output appear as a
tooltip, new window, or whatever you want--brilliant, and really easy
to use. This is probably the first time I've wished TextPad could do
some things a Mac editor can do, and not vice versa.
There's only one seemingly minor thing that's keeping me from buying
TextMate right now and retiring Tex-Edit Plus--TextMate's auto-identing
feature, where if I have a paragraph of text (not code), it
automatically inserts a tab on the next line when I hit return. This
drives me nuts because while I use my Mac editor for HTML at times, I
mainly use it to write documents that have normal indented paragraphs
of text. At the end of a paragraph in a word processor or email
program I'm conditioned to hit return, then hit tab for the next
paragraph--so having TextMate indent the next paragraph automatically
just means I end up with two tabs.
Does anyone know if there's a way to turn off auto-indenting of new
lines, or is that a feature being considered for a future release? If
there is a way to turn that off and I just can't find it, I apologize
for being an idiot in advance...anyway, thanks to the developer for
creating this, keep up the good work,
-Brian
Is it possible to close files that are open in tabs that are not
visible, i.e., located in the tab overflow without disturbing tabbed
files that are visible?
Greetings,
I'm just wondering if there is a graphic interface for key bindings in
the pipeline -- it seems to me that it would be in line with the
emphasis on customizability in TM to not have to tinker with a .dict
file. :)
Ciao,
David
hi
just a newly registered textmate user. and its great. i was wondering
if it will be possible (or if im missing it) to create a new tab (as in
a new file) within a project instead of having to open a new window -
saving it and then going back to my project where i can then see the
file and open it in a tab and edit it.
thanks
eoghan
>I'm not wedded to the colors, either, BTW.
A healthy attitude! But oh man, I don't want to go there. I always
like black on white text, and I know others love the dark green on
sage thing or black on white, and it gets very religious. Sort of
like tabs. :)
So I'm just adjusting syntaxes by hand and waiting until Allan adds
the magic CSS syntax coloring thing.
- Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
>I would like to automate some customization for some bundles (as
>colors), is the format in those .plist files standard (for instance
>Perl.plist)? If it is and you wanted to search for a parser for some
>programming language which keyword would you use?
If you are asking whether the 'names' of each color class (e.g.
Comments) in the .plist is standard across the bundles, I'd say it
would be a miracle if they were, since they were all hacked by
individuals who wanted their favorite language colored.
On the other hand, it might be possible for people to agree to use
keywords in their names so the XML could be parsed and the color
settings could be custom set by a big regexp search and replace.
For the record, BBEdit 8 recognizes the following colors for customization:
General: Foreground, Background
Guide Contrast [the color of non-page window]
Custom Highlight Color: Primary, Secondary
Highlight Insertion Point Line Color
Source Code: Keywords, String Constants, Comments
HTML Tags: General, Processing Instructions, Anchor, Image, Names, Values
TM bundles generally have more colors than that. But if Bundle
writers could agree on a reasonable base set and rename their names,
that could go a long way towards making the colors customizable
before Allan gets his next solution done.
Allan may have to set standards like this anyway, unless he writes a
small GUI Syntax File browser that displays the Names with a little
Color Picker patch. That would be fabulous, of course.
- Eric
This is a known problem with Launch Services. Basically, any new application (or new version
of) needs to become "trusted" by the OS before other applications can "see" it. To make an
application "trusted" you must double click one of its documents, then you'll be presented
with an alert from the OS that you "are opening this for the first time" blah blah. From that
point, the application is "trusted".
As a little advertisement, Yummy FTP works around this problem :-)
Hope that helps.
Best regards,
Jason
Jason Downing
----------------------------------
Yummy Software
Software so good you could eat it. Yum!
www.yummysoftware.com
----------------------------------
> A follow up...
>
> Removing the cache stuff didn't solve the problem. Eventually things
> started working after I did a "open with..." on a file. I don't know
> if it depended on having removed the cache before. Just finding and
> opening the app (and opening files from within) didn't do it.
>
> If it gets messed up again, I'll be able to test further. :)
>
>
> On Jan 3, 2005, at 10:55 PM, Allan Odgaard wrote:
>
> > On Jan 4, 2005, at 3:33, Patrick Kelly wrote:
> >
> >> My Fugu stopped finding TextMate. I don't know if where the prob is.
> >>
> >> I've got Fugu 1.1.2rc1 in my Applications folder,
> >> and TextMate 1.1b1 in my Applications folder too.
> >
> > Sounds like the Launch Services cache problem:
> > http://lists.macromates.com/pipermail/textmate/2004-December/
> > 001774.html
> >
> > ______________________________________________________________________
> > For new threads USE THIS: textmate(a)lists.macromates.com
> > (threading gets destroyed and the universe will collapse if you don't)
> > http://lists.macromates.com/mailman/listinfo/textmate
> >
>
> ______________________________________________________________________
> For new threads USE THIS: textmate(a)lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>
>
Hello,
Greame Merrall pointed out to me that the lookup aspect of the phpcc
tool (http://ian.ardes.com/phpcc) was not working quite right (thanks
Graeme). The problem is that the manual page lookup does not work when
the current function has been expanded from a partial word.
To fix this change line 19 of phpcc.php to:
storeLookupWord($matching[0]);
I'm hoping to release a new version of this soon, with some more
features, and with an easier installation process.
Cheers,
Ian White
Man, I wish I'd had this iCalendar bundle when I was working on my
last little project...
Anyway, I submitted two bug fixes using SVN:
- DTEND was getting highlighted as a END: event. Changed to look for
^BEGIN and ^END.
- Also removed '' from highlighting, as events like SUMMARY:Go to
Mom's house were getting wrongly highlighted.
Chris can always revert it if he doesn't like the changes...
- Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
My Fugu stopped finding TextMate. I don't know if where the prob is.
I've got Fugu 1.1.2rc1 in my Applications folder,
and TextMate 1.1b1 in my Applications folder too.
I tried downgrading both items but haven't been able to find a
combination that works.
I found this:
<dict>
<key>ODBEditorBundleID</key>
<string>com.macromates.textmate</string>
<key>ODBEditorCreatorCode</key>
<string>TxMt</string>
<key>ODBEditorLaunchStyle</key>
<integer>0</integer>
<key>ODBEditorName</key>
<string>TextMate</string>
</dict>
in /Applications/Fugu.app/Contents/Resources/ODBEditors.plist
What am I doing wrong?
On a related note, I just downloaded the latest Cyberduck 2.4b1 and it
now has TextMate in the pulldown selection for editors, but TextMate is
grayed out.
TIA
I've fixed the package name generation for the templates in the Java
bundle. I've implemented a bit of configurability to the bundle by
using a custom shell variable (set in the TM preferences) to override a
default regular expression. Check the source for details. If others
follow my example, I recommend implementing a reverse domain namespace
schema; I'm using "org_bravo5_Java" for variables used by the Java
bundle.
The newest version is (always, now) available at
http://telly.bravo5.org/~blalor/bundles/Java.tmbundle.tar.gz
--
__ ____
/ / / __/ Brian Lalor
/ _ \/__ \ blalor(a)bravo5.org
/_.__/____/ http://bravo5.org/
I would like to automate some customization for some bundles (as
colors), is the format in those .plist files standard (for instance
Perl.plist)? If it is and you wanted to search for a parser for some
programming language which keyword would you use?
-- fxn
How do I get all my txt, html, css, php, js, rb, and sql files to open
in textmate by default on OSX? It seems some of these extensions have
been hijacked and I don't know how to remap them globally. I'm a fairly
recent "switcher."
-t
>>It works pretty well and it catches in a 'jumpable way'
>>most of the errors and warnings that pdflatex produces. I leave it to
>>others to customize the path to pdflatex...
>
>This would work indeed, although I have the feeling it's a bit overkill
>to do this with perl ;)
Hey, it's only 56 characters in Perl!! :) Anyway, I wanted to get
it working before Allan comes out with an eventual fix.
>>Preview has an annoying habit of not refreshing files when they are
>>re-opened; otherwise this would be a complete replacement for TexShop.
>
>I use TeXniscope[1], which speaks a bit of applescript and is able to
>refresh the pdf.
Excellent recommendation! I changed my command to open TeXniscope instead.
- Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
Hi,
Since I upgraded to 1.1b1, at least some commands stopped working, and
log the following:
2005-01-03 11:39:32.683 TextMate[1804] *** -[NSCFDictionary
setObject:forKey:]: attempt to insert nil value
Is it possible to download the previous beta?
Cheers,
-Ralph.
>- If TextMate could also jump to the place in the output where the error
>was produced, it would be great, because context is often important in
>finding the cause of the error and it's very hard to define regexps to
>grasp all those things.
I am having trouble picturing this suggestion. An example?
>- Allow for multi-line captures: (pdf)latex produces quite verbose
>errormessages that almost always are on two lines. I haven't been able to
>get TextMate to catch both lines and let me see it back in the overview.
I 100% agree with this. This would be the equivalent of a flag on the
regexp of searching across newlines.
FYI, I had this exact issue and here is the command I wrote to work
around it. Basically, I put pdflatex into a nonstop mode and pipe it
through a script to erase any newline that isn't part of multiple
newlines. Then I figure out the name of the resulting .pdf file and
open it in Preview. It works pretty well and it catches in a
'jumpable way' most of the errors and warnings that pdflatex
produces. I leave it to others to customize the path to pdflatex...
Preview has an annoying habit of not refreshing files when they are
re-opened; otherwise this would be a complete replacement for TexShop.
I hope this is helpful! - Eric
---
Before Cmd: Save
Cmd:
/usr/local/teTeX/bin/powerpc-apple-darwin-current/pdflatex
-interaction=nonstopmode -file-line-error-style "$TM_FILEPATH" |
perl -e 'while(<>){$f.=$_}$_=$f;s/([^\n])\n([^\n])/$1$2/g;print;'
echo
echo "Previewing..."
echo $TM_FILEPATH | perl -e 'while(<>){s/\.tex$/.pdf/;print;}' | xargs open
Stdin: None
Stdout: Show in separate window
Pattern: (\d+|LaTeX Warning): (.*?)$
Format: $1: $2
File:
Line: 1
Col:
Hi All,
I packed up all my java snippets and commands and integrated them with
the nice syntax and template stuff that already existed in the Java
bundle.
Attached you will find a tarred and gziped Java.tmbundle. It adds a
truckload of capabilities. Just slap it in one of the appropriate
directories that TextMate looks in for bundles and tar xvfz
Java.tmbundle.tar.gz, restart TextMate and fly!
Allan,
I would like to get this shipping with TextMate if you are interested.
I think a lot of Java programmers would enjoy this stuff.
Lang Riley
Hi,
I love the way TextMate allows me to catch errors from the output and
make them clickable, so that I can quickly correct them.
But I think this process can be improved even more with two requests:
- Allow for multi-line captures: (pdf)latex produces quite verbose
errormessages that almost always are on two lines. I haven't been able to
get TextMate to catch both lines and let me see it back in the overview.
- If TextMate could also jump to the place in the output where the error
was produced, it would be great, because context is often important in
finding the cause of the error and it's very hard to define regexps to
grasp all those things.
Thanks,
Jeroen.
Command purpose: Do a reasonably valiant attempt to locate all senders
of a particular message/method within the project.
Usage: Highlight the method name, excluding the parameter portion of
the method signature, and execute this command. It will search across
all source in your project and return a clickable list of method
invocations. It doesn't work perfectly, but it often works very
satisfactorily. Example, you would like to find all the places where
public void handleRequest(HttpServletRequest request,
HttpServletResponse response) is used, simply highlight handleRequest
and execute the command which will bring up a window with links to
these occurrences.
Command:
grep -rn "\.$TM_SELECTED_TEXT(" $TM_PROJECT_DIRECTORY | grep "\.java"
Standard Input: None
Standard Ouput: Show in separate window
Pattern: ^.*\/(\w+\.java):(\d+):.*
Format string: $1 $2
File register: 1 Line: 2
Command purpose: Do a reasonably good job of finding all declarations
of a particular method within the project.
Usage: Same as above.
Command:
grep -rn "[ ]$TM_SELECTED_TEXT(" $TM_PROJECT_DIRECTORY | grep "\.java"
Standard Input: None
Standard Ouput: Show in separate window
Pattern: ^.*\/(\w+\.java):(\d+):.*
Format string: $1 $2
File register: 1 Line: 2
Command purpose: Do a reasonably good job of finding a class definition
within the project.
Usage: Same as above, but highlight the class name. Example,
Dispatcher d = new DispatcherServlet();, highlight DispatcherServlet
and execute the command. This will bring up a window with clickable
links to each declaration found.
Command:
egrep -rns "class[ ]+$TM_SELECTED_TEXT[ ]+" $TM_PROJECT_DIRECTORY |
grep "\.java"
Standard Input: None
Standard Ouput: Show in separate window
Pattern: ^.*\/(\w+\.java):(\d+):.*
Format string: $1 $2
File register: 1 Line: 2
Command purpose: Do a reasonably good job of finding an interface
definition within the project.
Usage: Same as above, but highlight the class name. Example,
Dispatcher d = new DispatcherServlet();, highlight Dispatcher (assuming
it is an interface) and execute the command. This will bring up a
window with clickable links to each declaration found.
Command:
egrep -rns "interface[ ]+$TM_SELECTED_TEXT[ ]+" $TM_PROJECT_DIRECTORY |
grep "\.java"
Standard Input: None
Standard Ouput: Show in separate window
Pattern: ^.*\/(\w+\.java):(\d+):.*
Format string: $1 $2
File register: 1 Line: 2
Command purpose: Open a window listing all the methods found in a
particular class. assuming the class containing the method definitions
exists in the project.
Usage: Highlight the class name for which you would like to search,
then execute the command. This will bring up a window, no links sorry,
that lists the method signature for each of the methods local to that
class, i.e., non-inherited methods. I find this useful when I quickly
want to find what methods are available without having to search for
the file or read documentation.
cat `egrep -rnsl "class[ ]+$TM_SELECTED_TEXT[ ]+" .` | egrep "public[
]+\<.*\>[ ]+\<.*\>\(.*\)[ ]+(throws .*|){"
Standard Input: None
Standard Ouput: Show in separate window
Pattern: ^.*\/(\w+\.java):(\d+):.*
Format string: $1 $2
File register: 1 Line: 2
Enjoy,
Lang Riley
Below are some useful java snippets and their explanations that I
created. I will try to take the time later to add them to the wiki:
Snippet result: Create a class in java with auto-generated package
name, author, date, class name.
Usage: For the autogeneration of the package you should create your
class file in its proper location, e.g., org.foo.bar.Batz.java would be
created in the directory bar which is a subdirectory of foo and org
directories. The autogeneration of package name and classname also
assumes that your class package directory structure has as its parent
directory a directory named 'src'. You can of course change that in
the third call to sed for both the package name and the class name.
Trigger: jcl (or whatever you want to trigger it with)
Snippet:
${1:package `echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*src.//' | sed 's/.[A-Za-z]*.java//g'`};
/**
* ${2:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*src.//' | sed 's/.*\.\([A-Za-z]*\).java/\1/g'`}
*
* @author ${9:`niutil -readprop / /users/$USER realname`}
* @since `date +%D`
*/
public class ${2:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' |
sed 's/.*src.//' | sed 's/.*\.\([A-Za-z]*\).java/\1/g'`} ${3:extends}
$4 ${5:implements} $6${7:,}$8 {
$0
}
Snippet result: Create a private scoped variable. Not that useful,
but heh, it is here if you want it.
Usage: No explanation necessary.
Trigger: jpv
private ${1:String} $2;
$0
Snippet result: Create a public scoped method
Usage: No special comments. Pretty straight forward.
Trigger: jpum
Snippet:
/**
* $2
*
* @param $4 $5
* ${6:@return} $7
*/
public ${1:void} $2(${3:String} $4) {
$0
}
Snippet result: Create an if statement with guard comment
Usage:
Trigger: jif
Snippet:
if ($1) { // $2
$0
}
Snippet result: Create a privately scoped method.
Usage:
Trigger: jpm
Snippet:
/**
* $2
*
* @param $4 $5
* ${6:@return} $7
*/
private ${1:void} $2(${3:String} $4) {
$0
}
Snippet result: Create a while statement with guard comment
Usage:
Trigger: jwh
Snippet:
while ($1) { // $2
$0
}
Snippet result: Create a try/catch/finally block
Usage:
Trigger: jtc
Snippet:
try {
$2
} catch ($1 e) {
$3
} finally {
$0
}
Snippet result: Create a class variable/constant.
Usage:
Trigger: jps
Snippet:
private static final ${1:String} $2 = "$0";
Snippet result: Create an if/else statement with guard comments
Usage:
Trigger: jelse
Snippet:
if ($1) { // $2
$0
} else { // $3
}
Snippet result: Create the package imports and instantiation code for
using jakarta commons logging package.
Usage: I would suggest executing the snippet in the import area of you
class definition and then cut/pasting the instantiation code to the
private member variable declaration area.
Trigger: jlog
Snippet:
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** Logger for this class and subclasses */
protected final Log logger = LogFactory.getLog(getClass());
Snippet result: Create a JUnit TestCase subclass for unit testing.
Auto-generates the package name and the proper imports for the class
that will be tested.
Usage: Assumes JUnit unit test class naming convention is followed
whereby if a class named UserDao is being unit tested, the unit test
class would be named UserDaoTests.java and would be located in a
parallel directory structure analogous to its package name. Also
assumes, as is standard convention, that unit test packages have as
their parent directory 'test' and the classes which they test have the
parent directory of 'src'. For example, UserDao.java would be located,
let's say, in src/org/foo/bar/dao/ and its unit test class,
UserDaoTests.java, would be in test/org/foo/bar/dao/. Of course, if
you don't work that way, you can message the regular expressions to
suite your environment.
Trigger: jtest
Snippet:
package `echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*test.//' | sed 's/.[A-Za-z]*.java//g'`;
import junit.framework.TestCase;
import `echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*test.//' | sed 's/Tests.java//'`;
/**
* ${2:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*test.//' | sed 's/.*\.\([A-Za-z]*\).java/\1/g'`}
*
* @author ${4:`niutil -readprop / /users/$USER realname`}
* @since `date +%D`
*/
public class ${2:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' |
sed 's/.*test.//' | sed 's/.*\.\([A-Za-z]*\).java/\1/g'`} extends
TestCase {
private ${5:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' |
sed 's/.*test.//' | sed 's/Tests.java//' | sed
's/.*\.\([A-Za-z]*\)$/\1/'`} ${6:`echo $TM_FILEPATH | sed 's/\//./g'
| sed 's/^.//' | sed 's/.*test.//' | sed 's/Tests.java//' | sed
's/.*\.\([A-Za-z]*\)$/\1/' | perl -e 'print lcfirst(<>)'`};
public ${5:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*test.//' | sed 's/Tests.java//' | sed 's/.*\.\([A-Za-z]*\)$/\1/'`}
get${5:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*test.//' | sed 's/Tests.java//' | sed
's/.*\.\([A-Za-z]*\)$/\1/'`}() { return this.${6:`echo $TM_FILEPATH |
sed 's/\//./g' | sed 's/^.//' | sed 's/.*test.//' | sed
's/Tests.java//' | sed 's/.*\.\([A-Za-z]*\)$/\1/' | perl -e 'print
lcfirst(<>)'`}; }
public void set${5:`echo $TM_FILEPATH | sed 's/\//./g' | sed
's/^.//' | sed 's/.*test.//' | sed 's/Tests.java//' | sed
's/.*\.\([A-Za-z]*\)$/\1/'`}(${5:`echo $TM_FILEPATH | sed 's/\//./g' |
sed 's/^.//' | sed 's/.*test.//' | sed 's/Tests.java//' | sed
's/.*\.\([A-Za-z]*\)$/\1/'`} ${6:`echo $TM_FILEPATH | sed 's/\//./g' |
sed 's/^.//' | sed 's/.*test.//' | sed 's/Tests.java//' | sed
's/.*\.\([A-Za-z]*\)$/\1/' | perl -e 'print lcfirst(<>)'`}) {
this.${6:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*test.//' | sed 's/Tests.java//' | sed 's/.*\.\([A-Za-z]*\)$/\1/' |
perl -e 'print lcfirst(<>)'`} = ${6:`echo $TM_FILEPATH | sed
's/\//./g' | sed 's/^.//' | sed 's/.*test.//' | sed 's/Tests.java//' |
sed 's/.*\.\([A-Za-z]*\)$/\1/' | perl -e 'print lcfirst(<>)'`}; }
public void test$8() {
$0
}
}
Snippet result: Create public getter/setter pair for a private instance
variable. This really comes in handy if you do a lot of dependency
injection style development, for bean properties.
Usage:
Trigger: jprops
Snippet:
public $1 get$2() { return this.$3; }
public void set$2($1 $3) { this.$3 = $3; }
Snippet result: Create a JSTL output statement for jsp code.
Usage:
Trigger: jcout
Snippet:
<c:out value="\${$1}"/>$0
Snippet result: Create an interface definition with autogenerated
package name, interface name, author name, and date.
Usage: Same as the usage for the java class snippet.
Trigger: jid
Snippet:
${1:package `echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*src.//' | sed 's/.[A-Za-z]*.java//g'`};
/**
* ${2:`echo $TM_FILEPATH | sed 's/\//./g' | sed 's/^.//' | sed
's/.*src.//' | sed 's/.*\.\([A-Za-z]*\).java/\1/g'`}
*
* @author ${3:`niutil -readprop / /users/$USER realname`}
* @since `date +%D`
*/
public interface ${4:`echo $TM_FILEPATH | sed 's/\//./g' | sed
's/^.//' | sed 's/.*src.//' | sed 's/.*\.\([A-Za-z]*\).java/\1/g'`} {
$0
}
Hope it helps someone, it sure has saved me a ton of typing.
Regards,
Lang Riley
I've been trying to get into the habit of using CVS, so I have created
a few TM command scripts that performs the basic CVS shell commands.
HOW do I convert the text returned from a Finder display dialog script
into a shell variable ????
sort of like this:
osascript -e "tell application \"Finder\"
display dialog \"mxCVS::Commit Message\" default answer
theDefaultAnswer buttons {\"Cancel\", \"OK\"} default button 2
set the theMessage to the text returned of the result
end tell"
$CVSmsg = output from the above AS script
I'm having a bug problem with the Applescript execution of "do shell
script", as AS can't somehow access $CVSROOT from .bash_profile or even
from /etc/profile which really pisses me off. Every other aspect of
CVS works OK, but not through AS.
Kind regards,
Mats
I wanted to have a beta out before the new year, so it's now available
:) I'm 'announcing' it since it turns out the automatic version check
was broken around 1.0.2b8 or so, in that it doesn't schedule a check
before the preferences window has opened.
So just open the preferences, and you should be told about it (if beta
versions are included in the check).
This bug actually lead to interesting statistics, because I can
correlate number of downloads with number of version checks (based on
IP address) and estimate how many actually open the preferences, which
is ~25%.
Beta 1 is btw only a minor update, as December wasn't my most
productive month. But it does feature mode-dependent lookup for
snippets and macros, which I think is rather cool :)
> > 1. Allow undo from find/replace dialog. Lots of times I enter in the
> > wrong regular expression and the find/replace goes badly. I want to
> > hit apple-Z and Undo it and fire up another search, but instead I have
> > to switch to the text window.
>
>hmm... so undo should fall through to the main window? currently I
>could do that, but if I introduce a multi-line mode for the
>find/replace strings it would probably be natural for these to also
>have undo/redo, which would then clash!?!
That's true too; it would be great to someday have undo in the
textbox. And maybe even commands! :)
Maybe instead of my suggestion there could be a little button on the
Find/Replace box that says Undo Last Replace?
2. PDF
Webkit already gives you PDF viewing for free, if you have Schubert's
PDF Plugin (doesn't everyone?) For instance, you can enter in the url
of a PDF file in TM's web preview and view PDFs right now. I just
need a way to tell TM to show a PDF in the web preview.
- Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
A few small requests for this marvelous editor.
1. Allow undo from find/replace dialog. Lots of times I enter in the
wrong regular expression and the find/replace goes badly. I want to
hit apple-Z and Undo it and fire up another search, but instead I
have to switch to the text window.
2. It would be great if the new ( :) ) txmt: resource locator allows
us to load things like txmt://a.pdf, which would then get loaded into
the web preview window. Reason: I want to hack up a replacement for
TeXShop within TM. Already you can make a command to have pdftex
create a .pdf output file and open it in Preview. I'd like it to show
up in TM! It would feel cleaner that way.
3. Allow syntax files to be reloaded. Then we could edit them within
TM and see the results without quitting and restarting.
best wishes, Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
here is a better google search command that escapes spaces and uses
highlighted text rather than the current word:
open http://www.google.com/search?q=`echo $TM_SELECTED_TEXT | sed 's/
/+/g'`
Standard input: selected text
Standard output: discard
Hi,
can you please make find/replace settings persistent between sessions
the way other settings are?
They revert to their default values each time I restart the editor.
David
Hi,
a common practice is to let Undo undo all characters entered during
last stroke (that is, not interrupted by movements or other operations
(find/replace/search) at once. That is, If I type a few words, then
press Option-Z, I expect all the words to disappear, not one letter at
a time. This is the way undo works in most environments, including
emacs, vi, TextEdit, AppleWorks, sam, acme, Word ...
David