howdy,
i just stumbled upon TextMate while looking for a native development
text editor and am _very_ impressed with it's featureset and believe i
will be purchasing soon.
i am wondering, however, if there is anyone out there who has
developed (or _loves_ to develop ;)) a syntax highlighting plist /
bundle for the Velocity Template Language
(http://jakarta.apache.org/velocity/vtl-reference-guide.html)? i am
terrible with regular expressions unfortunately, so i'm not having
much luck with it. it's basically a dynamic language like php or asp
and is mainly used in web (html type) files which can include css,
javascript, xml / xsl etc.... the best / closest type i've found to
work is the ASP style. it's _very_ close but would like to have
certain things highlighted differently and it's missing (obviously
since it's a different language) a bunch of declarations. i am
desperate for this type of highlighting.
if anyone is interested in helping me out, i could send an example
file that includes javascript, xml / xsl, css and Velocity markup. any
takers??
thanx in advance, jamal
Hi,
I'm attaching the compile script I use, or actually combination of scripts.
The compile script expects to get nothing as input and discards its output,
and the 'save active file before running command' thing should be on. The
command that runs it is:
compile-tm "$TM_FILEPATH" >/dev/null 2>&1 &
Two points:
- This reports on how things went via Growl---and it doesn't check if you
have it installed---so if you don't use it, you might want to go into the
'compile-report' script and change the Growl stuff to something else, like
maybe an AppleScript dialog box. (Just redirecting the output of the script
to a tooltip won't work without serious additional fiddling.)
- This tries to preview using TeXniscope.
The typeset script works analogously. I'm also attaching a script that goes
to the next TeX error by looking at the output file and piloting TM via
AppleScript (which is a bit slow and causes the 'go to line' dialog box to
appear briefly), and one that compiles the current selected text (but
requires the whole document as input).
Hope some of this might be of some use... It's not particularly earth-
shattering, but works OK for me.
On Dec 30, 2004, at 6:14 AM, Ivar Åsell wrote:
>
> From: Ivar Åsell <ivar(a)enskede.net>
> Date: 2004/12/30 Thu AM 05:14:54 CST
> To: TM Users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Help with LaTeX-build command
>
> Hi!
>
> I would like to be able to do this in TM
>
> 1. select a .tex-file
> 2. run a macro that
> 2.1 selects all text
> 2.2 runs that text through a "tex-compiler" wich listens to stdin
> 2.3 pipe the results from the "tex-compiler" to the preview-app (can
> this too listen to stdin?) which show me a nice pdf
>
> And if I like the results I can save the .tex-file otherwise not.
> The main point here is that I which to see the pdf without having to
> save my .tex-file.
>
> Would someone help me with this?
> I have an idea on how this is supposed to be done...
>
> 1. record a macro (alt-cmd-m)
> 2. select all text (cmd-a)
> 3. filter through command (shift-alt-r)
> 3.1 input: selection
> 3.2 output: ? discard?
> 3.3 command: ??? something like "<build pdf> | open -a
> /Applications/Preview.app"
>
> I just read that "open" cannot read from stdin so I guess it has to be
> some other way around.
> Please, I'm really lousy at this stuff.
> Help would be much appreciated!
>
> Kindest Regards
> Ivar
>
> ______________________________________________________________________
> 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
>
Hi!
I would like to be able to do this in TM
1. select a .tex-file
2. run a macro that
2.1 selects all text
2.2 runs that text through a "tex-compiler" wich listens to stdin
2.3 pipe the results from the "tex-compiler" to the preview-app (can
this too listen to stdin?) which show me a nice pdf
And if I like the results I can save the .tex-file otherwise not.
The main point here is that I which to see the pdf without having to
save my .tex-file.
Would someone help me with this?
I have an idea on how this is supposed to be done...
1. record a macro (alt-cmd-m)
2. select all text (cmd-a)
3. filter through command (shift-alt-r)
3.1 input: selection
3.2 output: ? discard?
3.3 command: ??? something like "<build pdf> | open -a
/Applications/Preview.app"
I just read that "open" cannot read from stdin so I guess it has to be
some other way around.
Please, I'm really lousy at this stuff.
Help would be much appreciated!
Kindest Regards
Ivar
Hi,
have you considered installing a web-based bug-tracking system
(bugzilla/RT/gnats/???) so users can submit bug reports and requests
for enhancements? It is much easier to track changes this way.
David
On Dec 30, 2004, at 0:25, Lars Pind wrote:
> [ default file/folder patterns ] So other people experiencing this
> problem, that's something to look for.
>
> Question for Allan: Is this on purpose?
The file/folder patterns are pretty much the result of evolution :)
I'm aware of the caveat about the preferences not reflecting existing
folder references. Interestingly I actually added this text to the
preferences pane yesterday -- but ideally it should affect non-changed
folder-reference patterns.
> It seems very confusing that there's a preferences pane setting that
> doesn't have any effect.
They are defaults (as implied by the label), i.e. used when creating
new folder references. But your critique is fair.
I'd like to be able to set my "indentation level" to 4 and leave the
tab stops at 8. That is, if I hit my tab key the cursor should move as
if my tabs stops are set at 4 (any any spaces required should be
added). If there are any actual tab characters in the file, the file
should display as if I had selected 8 as my tab size. (Basically this
is because I edit files that other people have edited using emacs which
"intelligently" uses tabs where it can to fill in sequences of 8
spaces.)
I was playing with the notion of expanding all the tabs to spaces so
that it will display properly even if I have my tab size set to 4, but
I'm afraid this will cause lots of extraneous differences when I check
in my changes to CVS.
Another item is that when I'm working in Tcl I want my indentation
level to be 4 characters. When working in PL/SQL I want it at 8.
(Probably in C or C++ I'd want 2 or 3.)
Allan,
It would be nice if the contextual menu for folders had an option
"Expand All" or some such that would expand all sub folders of the
currently selected folder.
Thanks.
Some features of the "bbedit" command line tool are discussed in this
review of BBEdit 8.0:
http://www.macdevcenter.com/pub/a/mac/2004/12/21/bbedit.html?CMP=ILC-
macrss&ATT=BBEdit+8.0++A+Developers+Viewpoint
For my taste, the notable bits are:
(1) The '--clean' option for suppressing the 'Do you want to save
changes?' dialog.
(2) The tool is installed from a button in the preferences.
Just some food for thought/discussion for the eventual TextMate
command-line tool.
Chris
> An Even Cooler Command Line
> I do quite a bit of work from the Terminal (well, iTerm, really)
> command line, and the new BBEdit Unix tool is useful in all the ways I
> wish the previous versions were. Before, I had to give BBEdit the -c
> switch to create a new document. Now, it figures that out on it's own.
> If I have the preferences set to open new documents in the front
> window, when the BBEdit tool opens multiple documents, they open in
> the same window.
>
> The latest update makes it even better. I can now pipe output from a
> command line process into BBEdit without creating an unsaved document.
> That way, I don't have to go through the annoying "Do you want to save
> changes" dialog. Once I've seen it and want to get rid of it, I just
> close the document.
>
> % netstat -rn | bbedit --clean
>
> I wish I had this feature for the "Unix Script Output" window I get
> when I choose "Run" from the "#!" menu (which I've set to
> Shift-Apple-R with the "Set Menu Keys..." item from the BBEdit menu.
>
> It gets even better, though. If I want to look at piped output, I want
> to read it from the top. Previously, BBEdit placed the curser at the
> end of the output, but I can now start off at the top of the output.
> % netstat -rn | bbedit --clean -view-top
>
> To get this updated version of the command line tool, you have to go
> to the Preferences. In the Tools pane, click on the button that says
> "Install Command Line Tools," which installs the latest versions of
> BBEdit and bbdiff.
>
>
>
With the holidays fast approaching and people drifting away from their
desks to do far more entertaining things than write code all day, I
though this was an appropriate time to:
a) wish everyone a very happy Christmas time, if they celebrate the
festival or not ;)
b) offer my thanks again to Allan for providing us with such a great
product. I spend all day, every day working with TextMate and it's the
first time I've actually felt 'at home' coding on the Mac since
switching last January.
That's all really :)
drew.
I'd like to make a bundle with PL/SQL syntax (didn't look like anyone
did that yet), but I don't see how to specify pairs of folding markers.
Here's an example of what's wrong:
PropertyList-Old.plist has these lines:
foldingStartMarker = "(\\{|\\()";
foldingStopMarker = "(\\}|\\))";
But what causes folds on bad blocks like this:
{ # curly brace
) # parenthesis
I'd like to do blocks like these:
IS -> END;
IF -> END IF;
( -> )
etc.
Possible? I see "pairs" of other things are being handled
(e.g.highlightPairs), perhaps we could do this too!
prl
A while back I posted about the possibility of having a history list
for tabs so that you could use a keyboard shortcut to quickly switch to
the last file you were editing. The resolution proposed was to use
drag sorting to locate the files next to each other, and then use tab
navigation to switch back and forth. With only 3 or 4 visible tabs and
many files open, most of my open files are pushed off the tab bar. Can
you drag sort items if they are not currently visible as a tab?
I still think my history list idea has merit. Maybe everyone else is
far more organized, but I've basically devolved to using the mouse and
the project drawer to switch files -- unless I know I am going to be
editing two files side by side for a while, in which case I will close
one -- switch to the other, then open the first one again so that I
know they are side by side.
I realized that this style of working is essentially what I would like
out of the History List that I proposed. In other words, if you
completely ignore the tab bar as a traditional tab bar, it would
function exactly like the history list if -- when switching to a file
from the project drawer, the file acts as if it was not open, and
appears as a tab to the right of the currently open tab.
I fear I did not explain that well, but the idea is simple. When
selecting a file for edit, first close the file, then open it (or
behave as if this was done). If the file is selected from the tab bar,
then leave the behavior as it is. With this behavior, the tab bar
would become a history list, and it would be simple to swap between
files using the already existing tab navigation shortcuts.
Is anyone else overwhelmed by the tab navigation as it stands? This
metaphor works great for something like browsing -- because I can open
up a new window if I have too many tabs already open in the current
window. I hate to keep bringing up emacs-isms, but the switch buffer
commands are very powerful (switch to last buffer, or switch to buffer
by using filename completion). Combine the project drawer with some
sort of history navigation, and I would be very happy.
Thanks,
Wayne
hi folks,
I am startled but gratified at the response to the Un/Comment hack.
I added a number of fixes and options people have been asking for and
packaged it up into a .tmbundle so you don't have to copy in the
hideous Perl 1-liner (but you can... attached below). In the bundle,
I also included the source code, which is released as Niceware.
That's like the Perl Artistic License, except that you have to be
nice to me when you criticize the code.
The bundle lives at <http://math.sfsu.edu/hsu/textmate>.
Changes
- I added some options. To invoke them, put them on the command line, e.g.
perl -e '...' "$TM_FILEPATH" first-column comment .tex
- so if you want separate comment/uncomment, make two commands with
one option 'comment' and the other 'uncomment'
- I added a bunch of filetype endings, including the ones in Chris
T's beautiful Ruby script.
- fixed Ollivier Robert's newline bug
- Drew McLellan: I added CSS, but sadly, I can only comment each
line, not the whole thing. I hope that is still useable.
Options
# 'first-column' puts the first comment marker at the line start
# 'comment' always comments (for people who want the smartness, but
not the toggleness)
# 'uncomment' always uncomments. If you foolishly use both comment
and this, comment wins.
# 'comment-whitespace' comments whitespace which we normally skip.
# '.tex' will force the use of TeX style comments. You can substitute
your favorite ending, like '.java' or '.pl'. The leading dot is
important. Last type listed wins.
# 'toggle' changes the comment status line by line. Normally, the
whole thing is a block.
best wishes, Eric
---
If you install the thing as a tmbundle, you can also install it as a command as
Before: do nothing
Command:
~/Library/Application\
Support/TextMate/Bundles/UnComment.tmbundle/comment-toggle.pl
"$TM_FILEPATH"
STDIN: Selected
STDOUT: Replace Selected
To install it as a command as a one-liner, with no path issues:
Before: do nothing
Command:
perl -e
'$markers={"pl,pm,rb"=>["#",""],"plist,c,css,m+h,cp,cpp,h,p,pas,js,htc,c++,h++"=>["/*","*/","//",""],"java,cc,mm"=>["//","","/*","*/"],"html,htm,xml"=>["<!--","-->"],"bib,ltx,tex,ps,eps"=>["%",""],"php"=>["#","","/*","*/","<!--","-->","//",""],"mli,ml,mll,mly"=>["(*","*)"],"script,adb,ads,sql,ddl,dml"=>["--",""],"f,f77"=>["C
",""],"inf,f90"=>["!",""],};$tab=4;while(($k,$v)=each(%$markers)){foreach(split(/\s*,\s*/,$k)){$c{"$_"}=$v;}}$_=shift@ARGV;($type)=/\.([^.]*)$/;foreach$option(@ARGV){if($option=~/^\.(.*)$/){$type=$1;}$opt->{$option}++;}unless($c{"$type"}){$type="pl";}($start,$finish,@etc)=@{$c{$type}};$isntfirst=0;while(<STDIN>){push@in,$_;($indent)=/^([
\t]*)/;$indentl=0;foreach$j(1..(length($indent))){$ch=substr($indent,$j-1,1);if($ch
eq"
"){$indentl++;}else{unless($indentl%$tab){$indentl+=$tab;}else{$indentl+=$indentl%$tab;}}}unless($isntfirst){$indentmin=$indent;$indentminl=$indentl;$isntfirst++;}else{if($indentl<$indentminl||$indent
eq""){$indentmin=$indent;$indentminl=$indentl;}}}$isntfirst=0;foreach(@in){$lineend="";if($opt->{"toggle"}){$iscomment=$isfirstofpair=$isntfirst=0;}if(chomp){$lineend="\n";}unless(/\S/){unless($opt->{"comment-whitespace"}){$out.=$_."\n";next;}}unless($isntfirst){$isntfirst=1;foreach$delimiter(@{$c{"$type"}}){$isfirstofpair=1-$isfirstofpair;$delimiterq=quotemeta($delimiter);if($isfirstofpair){if(/^\s*$delimiterq/){$iscomment=1;$start=$delimiter;$startq=$delimiterq;}}elsif($iscomment){$finish=$delimiter;$finishq=$delimiterq;last;}}}if($opt->{"uncomment"}){$iscomment=1;}if($opt->{"comment"}){$iscomment=0;}if($iscomment){s/^(\s*)$startq(\
)?/$1/;s/(\
)?$finishq(\s*)$/$1/;$out.=$_.$lineend;}else{if($opt->{"first-column"}){$out.=$start;unless($indentmin){$out.="
";}$out.="$_";if($finish){$out.="
".$finish;}$out.=$lineend;}else{s/^$indentmin//;$out.=$indentmin.$start."
$_";if($finish){$out.=" ".$finish;}$out.=$lineend;}}}print$out;'
"$TM_FILEPATH"
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
Similar to other commands that ship with TM, but escapes spaces for the
URL. There is probably a better way to do this, but this works.
Before running command: Do nothing
Command: open http://dev.mysql.com/doc/mysql/search.php?q=`echo
$TM_SELECTED_TEXT | tr " " "+"`
Standard Input: None
Standard Output: Discard
Enjoy and share your improvements please.
TextMate 1.0.2 writes stuff like this into my console whenever I close
a document window:
2004-12-22 14:31:27.473 TextMate[590] Another workaround for GCC
Any comments on what that's about?
I'm trying to get the ruby version of the (Un)comment command running on
my box, and I'm getting the following error:
/Users/wneuman/Library/Dev/TextMate/comment.rb:1: undefined method
`extname' for File:Class (NameError)
You say that the script requires Ruby 1.8, and I should be fine there as
I've got 1.8.1 installed...
Of course, the amount of Ruby I know would fit handily in my back pocket
-- even if I had stuffed my back pocket full of marbles. handkercheifs,
and gum wrappers beforehand, so I might just be doing something stupid
here. Any ideas on how to fix this?
William D. Neumann
---
"There's just so many extra children, we could just feed the
children to these tigers. We don't need them, we're not doing
anything with them.
Tigers are noble and sleek; children are loud and messy."
-- Neko Case
Think of XML as Lisp for COBOL programmers.
-- Tony-A (some guy on /.)
Hi,
Here's another feature request: Could you make selecting newline
characters a bit easier?
At the moment it is virtually impossible drag-select some text and the
newline character of a line that is followed by a non-empty line.
For an example of how it could be done better is TextEdit. If you select
a text there and drag a distance past the newline character, the newline
character is also included.
Thanks, Jeroen.
An improvement on my earlier post.
Now you can just execute a portion of your sql the whole thing and jump
to errors:
Before running command: Do nothing
Command: [your path to mysql if not in bash's path environment
variable]/mysql -u[your username here] -p[your password here]
Standard Input: Selected Text or Entire Document
Standard Output: Show in separate window
Pattern: ERROR (\d+) at line (\d+): (.*)
Format String: $3
Line: 2
Here is a command that will compile and jump to the line of the file
with the error:
Before running command: Do nothing
Command: cd [directory where build.xml is located]; ant [your target to
build source];
Standard Input: None
Standard Output: Show in separate window
Pattern: .*/(\w*.java):(\d+):(.*)
Format String: $1 $2 $3
File register: 1 Line: 2
Someone can improve on this to get the column and more error
information too. That would be nice.
Hi folks,
I missed a command from BBEdit that let you comment and uncomment
text magically for different languages with the same keystroke
(Text->Un/Comment), so I wrote a version for TextMate. If there is
enough interest, I will release commented source code and make it
into a nice .tmbundle. It currently only supports perl, php, html,
plist and tex. It is trivial to add support for other languages,
which I'll do on request (or you can easily figure out yourself, I
think... if you do, send me an e-mail so I can update mine!).
If the selection's first line is a comment; if so, it uncomments the
rest of the selection.
If not, it comments the whole selection, line by line. It tries to
keep the selection's indentation.
It parses the filetype from the filename ending to figure out what
are comments. If a language has more than one kind of delimiter pair,
it will use the first pair in the list for commenting, and will
search for all listed pairs for uncommenting. Notice this last
feature improves on BBEdit's Text->Un/Comment functionality. The
delimiters are stored in $a in the format "a,b,c"=>[$first, $last],
where each of the file endings .a, .b and .c will use that delimiter
pair. Roll your own!
This version is actually better than BBEdit's, in my opinion, because
1. it can uncomment many different comment formats for silly
languages like PHP that support several; and
2. it places comment delimiters at the original level of indent (and
not the first column like BB does); and
3. we can all customize it.
Textmate is powerful!
best wishes, Eric
--
To install it as a command:
Before: do nothing
Command:
perl -e
'$a={"pl,pm"=>["#",""],"plist,c"=>["/*","*/"],"html,htm"=>["<!--","-->"],"tex,ltx"=>["%",""],"php"=>["#","","/*","*/","<!--","-->","//",""]};while(($k,$v)=each(%$a)){foreach(split(/\s*,\s*/,$k)){$c{"$_"}=$v;}}$_=shift@ARGV;($t)=/\.(.*?)$/;($s,$f,@etc)=@{$c{$t}};$b=0;while(<STDIN>){push@in,$_;($in)=/^([
\t]*)/;$inl=0;foreach$j(1..(length($in))){$ch=substr($in,$j-1,1);if($ch
eq"
"){$inl++;}else{unless($inl%4){$inl+=4;}else{$inl+=$inl%4;}}}unless($i){$ind=$in;$indl=$inl;$i++;}else{if($inl<$indl||$in
eq""){$ind=$in;$indl=$inl;}}}$i=0;foreach(@in){if(chomp){$n="\n";}unless(/\S/){$o.=$_."\n";next;}unless($b){$b=1;foreach$d(@{$c{$t}}){$i=1-$i;$d=quotemeta($d);if($i){if(/^\s*$d/){$y=1;$s=$d;}}elsif($y){$f=$d;last;}}}if($y){s/^(\s*)$s(\
)?/$1/;s/(\ )?$f(\s*)$/$1/;$o.=$_.$n;}else{s/^$ind//;$o.=$ind.$s." $_
".$f.$n;}}print$o;' $TM_FILEPATH
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
Sometimes you want to execute the SQL contained in the current file via:
Before running command: Do nothing
Command: [your path to mysql if not in bash's path environment
variable]/mysql -u[your username here] -p[your password here] <
"$TM_FILEPATH"
Standard Input: None (because $TM_FILEPATH is specified above; you
could use just selected text too with $TM_SELECTED_TEXT)
Standard Output: Show in separate window
If you have line numbers showing in the gutter you can quickly find any
syntax errors that mysql returns.
Simple. Useful.
After reading peoples comments about ftp programs last week I tried
yummy ftp and I am very close to buying it. I love that I can select a
remote file and hit cmd-B to open it in textmate. Is this the killer
feature people where asking for?
Does anyone else have reviews for this product?
Later,
Eric
PS. I liked it so much I remapped my open in text editor in PathFinder
to cmd-B as well so most of the time I am ready for a quick edit.
I've posted the latest Perl bundle to
http://math.sfsu.edu/hsu/textmate/. Changes do not include
recognition of Coffee Services. :)
They do include:
(12-20-04)
Martin Vetter added [] and () to the Perl folding syntax.
__DATA__ now highlights to the end
q qq qw qx quoting is nicer
Noah Daniels submitted bug fix to color POD starting with ^= and
not just ^=head1
Noah Daniels also submitted bug fix for $#foo being counted as a comment.
Known problems: here-docs not quoted, many autoquotes not
highlighted right, e.g. hashkeys in => notation.
best wishes, Eric
--
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu(a)math.sfsu.edu
http://math.sfsu.edu/hsu
Textmate is looking awesome (I just tried it Friday for the first time)
and though I own a copy of BBEdit, I think I may switch. But there are
a couple of things still missing, IMHO.
First, the Perl syntax bundle doesn't handle POD (=begin, =cut, etc.)
yet. I very quickly hacked in support for simply =begin and =cut as
block comments, but it would be ideal if it could do as good a job as
BBEdit's syntax coloring for Perl/POD.
Second, I do miss BBEdit's integration of certain things in its script
menu - 'find in reference' (really just shelling out of perldoc -f) and
'view POD' (just shelling out of perldoc), as well as the ability to
execute in the debugger. It would be nice to be able to, within a
project, execute things like 'perl -d <filename>' and such - or for a
C/C++ program, run it in gdb. I realize this can be done in Textmate
using the Automation->Commands menu, so perhaps what I'm saying is that
a few more built-ins would be nice :)
Finally, for the syntax bundles, the non-uniformity of color schemes
between bundles (I routinely work in projects involving Perl and C
code) could stand to be improved - ideally, a way to graphically change
the colors for the syntax bundles would be nice, too, rather than
editing the bundles. For example, rather than specifying the RGB values
in each syntax plist, have an indirect color code - for example,
"keyword" or "comment" - and then in TextMate have a preference that
allows you to specify colors for all of those, globally.
Anyways, TextMate is looking great. Keep up the good work!
--
"Failure is not an option, it comes bundled with the software" -DefCon
10
Noah M. Daniels
ndaniels(a)mac.com
...Remote file or URL was invalid"
...is the message I got when I try :
"TextMate-->Preferences-->Software Update-->Check Now"
(TextMate v1.0.2 (2004-12-10))
Is it a known issue, or does it come from me?
Best regards,
--
Jo <W:00°04'37" ; N:47°15'36">
1....'....12.....'....24.....'....36.....'....48.....'....60.....'....72
I'm working with a project whose files are on an SMB share. The sort
order of files and folders is not alphabetical, making it crazy
difficult to find files :)
Have I somehow messed up the order? Can I reset it to alpha?
Projects on my local disk are ordered alphabetically as expected.
cheers
drew.