Anybody wish to help me with a pattern for the PHP language bundle? I
have embedded SQL under a variable such as below. I'm having trouble
excluding the addslashes part from the scope.
$sql = "WHERE category = '" . addslashes($category) . "'";
...or...
$qid = DB::query("
WHERE category = '" . addslashes($category) . "'
");
The pattern I've come up with so far:
{ name = 'meta.scope.sql';
begin = '(dbQuery|DB::query)\("|\$\w*(sql|where)\w*\s*=\s*"';
end = '"\)|";';
patterns = (
{ include = 'source.sql'; },
);
contentName = 'source.sql.embedded';
},
I'm new at this so any help would be appreciated.
Thanks,
Quinn
Whenever I run an external command, I'm getting errors about missing
require_cmd or CocoaDialog. I've followed some of the tips about
looking in $TM_SUPPORT_BUNDLE/bin and such but can't seem to find
those commands/scripts.
Is there something broken with my install I can fix?
-jon
I have playing with TextMate for about a week and don't seem to find
a "bracket" matching feature.
Example, when I double click on a { or [ or (, the match closure is
found and all code in between is highlighted. Or something to that
effect. I have seen other editors simply highlight both the begin
and end characters when the cursor is on one of them.
Am I missing something obvious or does this not exist?
thanks, ke han
Hi
Here's a question for the latex pro's: Do you know if special
characters like german umlauts are allowed in labels? e.g.:
\section{Mein grünes Apfelbäumchen}
\label{mein_grünes_apfelbäumchen}
It works when typesetting the document. I just wanted to know if this
is valid code. Because if _not_ then it would be nice, if these would
be escaped automagically when using the section, subsection and
subsubsection snippets. E.g.:
\section{Mein grünes Apfelbäumchen}
\label{mein_gruenes_apfelbaeumchen}
If it's easier to accomplish, you could also just escape a for ä, u
for ü, and o for ö, etc.
Another nice enhancement would be if the \section and \label commands
would each be on a seperate line. I just asked about the oppinions on
this in the irc channel and I got at least one more vote for this ;-)
Cheers. Oliver
When I select a word by double-clicking on it and then hit either the
left or right arrow key, I expect the word to be deselected and the
caret to end up at the start or end of the word. This isn't what TM
[Version 1.5 (906)] is doing for me now, and its breaking a macro I'm
trying to create.
It appears that hitting an arrow key with text selected by double-
clicking puts the caret one character to the left or right of where
the double-click happened. No other current Mac program that I use
does this, nor can I remember any other Mac program ever behaving
this way (going back to 1985). So, unless I've inadvertently changed
some setting to start this behavior, I would call this a bug.
FYI, the arrow keys work as expected when the selection is made by
swiping or shift-clicking.
--
Dr. Drang
I've released version 2 of my screenwriting bundle.
release: http://ollieman.net/words/2006/03/
screenwriting_with_textmate_20.php
bundle: http://ollieman.net/code/screenwriting/textmate/
---
I've tried to document it into the ground, which is the reason there
are so many instructional videos. (I hope you finally understand what
I'm doing, Haris)
From the release:
> It may seem oblique that the reason I learned the first bit of CSS
> and XHTML I did was because late one night I was pissed off at
> Final Draft for crashing for the 3rd time in a row. I was convinced
> that there had to be a better way, that there had to be a way to
> write screenplays that didn’t hurt. I don’t remember why this
> propelled me to CSS, but it did.
>
> Well, I can now firmly say that I have found a way of writing
> screenplays that doesn’t hurt. Never-mind that I had to build it
> myself, never-mind that the process took me over a year. I’ve found
> it.
I'd like to take a second and thank all of you for helping me with
this. It's an amazing thing that I've managed to build for myself (at
least) an end-to-end solution for writing screenplays that I actually
enjoy using. And no small part of that is due to the users of this
list, you have made this a learning experience that has resulted in a
useful tool.
It's not just that TextMate is my new favorite app. It's that I feel
as though Allan and the community around TextMate are genuinely
working together to advance the quality of our collective writing
environments; it's not just features and buttons, it's progress. And
for that, I cannot thank you enough.
-- oliver
ollieman.net
Just a quick question this time.
Is there any practical difference between 'edit›select›paragraph' &
'edit›select›line'?
I expected that 'select›paragraph' would not select the newline at
the end of the string, leaving me free to delete a block of text and
not remove the line itself from the document. This (expected)
behavior would really be nice for some macros I'm working on.
— oliver
I've been using TextMate for Ruby on Rails development for over a month
now. One thing I missed from some Java IDEs was documentation popup.
With TextMate, you can hit control-H on a symbol and the Ruby bundle
will use `ri` to try to find it. Sometimes it works, sometimes not.
However, Ruby gems (such as Rails) are not processed for use by ri. To
do that, you have to do it manually. I performed the following this
task with just one command on the terminal:
rdoc --ri-site /usr/local/lib/ruby/gems/1.8/gems/act*/lib
The '*' will expand to all of the active... action... stuff that is for
rails. Once this completes (which will take a few minutes), you can
finally use control-H for rails related classes and methods and get
quick access to documentation. Sweet!
Oh, for some caveats on this technique, check out this URL:
http://www.codecomments.com/archive327-2005-5-510886.html
So basically this technique isn't perfect but it's better than before.
~ Dave Smiley
Hi all,
I'm having problems with big files. TextMate, for me, is practically
unuseable for many applications, and I'm not sure wether something is
wrong, or I'm just witnessing limitations of the app itself.
TextMate takes upwards of 3 minutes to paste moderately long pieces
of text (30-70 KB) without line breaks. I use TextMate to edit
Wikipedia entries, which are sometimes badly formated. Thirty
thousand characters and not a newline in sight. When I copy texts
like that and try to paste them into TextMate, it practically dies.
Three times out of five, it won't recover. If it comes back, it's
unbearably slow and practically unuseable. Am I doing something
wrong, or is this a known issue? I am on a G4 1,25GHz with 1 GB of RAM.
Firefox's textfields can handle pasting and editing of 1MB snippets
(I tried) without a hitch, EVEN in those JavaScript rich editor
abominations, which probably aren't the most optimized pieces of code
ever to parse text. And that's with all the other crap going on, like
10 tabs open and several exensions installed.
What's going on?
Michael Ströck
Hey all,
I just started tasting TextMate today, great app.
I was wondering is there any trick to get "creating files from
templates" functional? I mean nothing happen when I click the
"create" button.
Here's some error from my console.log that I guess which is related
to the problem I'm facing:
2006-03-07 18:26:01.742 TextMate[2305] Error laoding '/Applications/
TextMate.app/Contents/SharedSupport/Bundles/Java.tmbundle/Templates/
addrbook.awk/info.plist' as Templates
2006-03-07 18:26:01.742 TextMate[2305] Error laoding '/Applications/
TextMate.app/Contents/SharedSupport/Bundles/Java.tmbundle/Templates/
templatize.sh/info.plist' as Templates
Tank you for your help.
S
When writing Markdown, I like to use reference-style links:
[link text][id]
.
.
<rest of text>
.
.
[id]: http://www.site.com
I've written a snippet that does some of what I want:
[${1:description}][${2:id}]$0
[${2:id}]: ${3:href}
but it puts the reference on the line below the link rather than at
the bottom of the file. Although I haven't done it, I suspect that
writing a command that takes the link label line and puts it at the
bottom of the file wouldn't be too difficult. But before I give it a
try, I'd like to know if it's possible to combine the snippet and the
command into a single instruction that allows me to enter the 3
pieces of information, puts the link label at the bottom of the file,
and leaves the caret back at the [id].
--
Dr. Drang
It seems that the CMD-CTL-G "New Folder" shortcut isn't working. Is
anyone else having this problem, or is it just me? Cheers,
Ben
___________________
Ben Jackson
Diretor de Desenvolvimento
ben(a)incomumdesign.com
http://www.incomumdesign.com
On Mar 6, 2006, at 4:43 AM, textmate-request(a)lists.macromates.com wrote:
> From: Domenico Carbotta <domenico.carbotta(a)fastwebnet.it>
> Date: March 5, 2006 2:39:50 PM MST
> Subject: Re: [TxMt] Latest Python Bundle?
>
> Il giorno 05/mar/06, alle ore 21:39, Owen Densmore ha scritto:
>
>> Are these in the Subversion repository? I tried to download the
>> entire bundle set from svn using the instructions on:
>> http://macromates.com/wiki/Main/SubversionCheckout
>> but it had an error.
>
> probably you should've set UTF-8 as the text encoding. if you've
> already done it, paste the error message so that we can help you :)
Domenico: Grazie mille per la aiuto! Vorrei tanto essere in Italia
adesso.
Well, naturally as soon as I try to re-create the error I got,
everything worked fine! I just checked out all of revision 2825 with
no error so likely everything is fine.
> the rationale for not providing "for", "if" and such snippets is
> that they're not _that_ useful in speeding code writing. I don't
> use the "def" snippet either... :)
> the "class" snippet is useful mainly because of the smart-
> constructor feature.
Thanks for the clarification .. I do agree python is so brief and
clear that it doesn't need a lot of extra help.
> ciao,
>
> Domenico
-- Owen
Owen Densmore
http://backspaces.net - http://redfish.com - http://friam.org
Hello,
I've been a lurking member of this list for some time, but this is my
first attempt at posting. I've been trying out TextMate in demo mode
and plan to buy it because it's nearly perfect for the way I work,
but I have a couple questions I'm hoping somebody could clear up for me.
I'm not a programmer, so please forgive me if my questions seem
somewhat elementary. I do, however, use the Terminal quite often for
shell commands, and I understand PHP well enough to write code for my
own purposes. I prefer coding my web pages by hand, and I'm fluent in
XHTML and CSS and competent in XSLT. I'm a bit anal about clean
coding, usability, and accessibility (both for the end user and for
me when writing my pages). For these reasons among others, I've been
disappointed by virtually all of the website generation applications
and/or scripts I've tried. It seems they require lots of convoluted
configuration that just gets in my way. Besides, I'd rather just do
it all myself with flat text files, using scripting just to generate
the headers, footers, navigation, etc.
I'm not necessarily concerned with TextMate's ability to do the many
super-complicated things it obviously can do, as I probably won't use
most of it myself. However, I'm wondering if it has a feature similar
to the Persistent Includes available in BBEdit. I have examined the
manual and read about how to use snippets, templates, commands, and
the like, and I understand how these could be used to make my life
easier. The problem is that I haven't figured out if there's a way to
re-parse an entire project or certain files within a project after
I've made changes that will affect the output.
For instance, if I've used a script to output links to all the files
contained in the directory (as a navigation menu of sorts) but later
add more files to that same directory, I'd like to be able to re-
generate the entire site so that those new files show up in the menu.
Likewise, if I've generated prev/next links to other files in the
same directory, I'd like to have them updated without having to
manually type the new hyperlinks into each and every file of the
site. I know I could use PHP or server-side includes or something
similar (and I have written a simple php function to do just that),
but I'd really like to generate static web pages because having
dynamic pages online really isn't necessary for what I'm doing (also,
I can upload the same files both to .Mac and to my virtual host, for
example).
If nothing resembling Persistent Includes is available in TextMate,
another viable option would be to auto-generate the output of an
entire project but save it to a new directory on my system using the
same hierarchy of the original project. That way, I can simply re-
generate it whenever I need to. In fact, that would probably be a
simpler solution than the Persistent Includes idea, but of course you
all probably know much more about how to efficiently accomplish this
than I do. Also, if anyone could point me in the direction of a good
streamlined tutorial on how to use shell scripts in an environment
such as TextMate, perhaps I can figure it out on my own. The TextMate
manual is nice, but something more tutorial-like would help a lot.
Sorry for the long post - it actually started out longer with more
details about my background and what I do, but I figured people may
get annoyed, so I cut it. If I need to further clarify exactly what I
need to accomplish, please ask, but I suspect most of you are quite
familiar with BBEdit and know about how Persistent Includes work and
how they differ from regular Includes.
Thanks,
Crystal
I've made a bit of progress in writing a MediaWiki bundle, the goal
of which would be to allow one to use TextMate as an external editor
on Wikipedia and other sites using the MediaWiki software. I've
written an alpha version of a Ruby library to machine-read/screen-
scrape wiki pages -- for example:
page = new MediaWiki::Page('TextMate')
page.contents.gsub!(/Textmate/, 'TextMate')
page.save('Corrected capitalization')
I've also built a few proof-of-concept TextMate commands -- fetch
selection from Wikipedia, etc., and have done a very small amount of
work on a MediaWiki syntax grammar (though the one described here
<http://lists.macromates.com/pipermail/textmate/2006-January/
007623.html> might be further along).
In short, I'm trying to replicate as much as possible of the
functionality of mwjed <http://www.djini.de/software/mwjed/>, a jEdit
plugin with the same purpose. This would include being able to
configure multiple wikis independently, log in, etc., so the bundle
will have to keep track of a bit of configuration info.
If anyone is interested in contributing to this project in any way,
or has any ideas on how I can more elegantly keep track of a wiki
"instance" across individual pages, please let me know. I'm decent
enough in Ruby to get by (though my code could definitely benefit
from another pair of eyes), but if you've got specific expertise in
Objective-C I'd love your assistance in writing some dialogs like the
ones in the Subversion bundle.
The bundle is in no way ready for inclusion in the bundle repository,
but I can share what I've got with anyone who's interested. I invite
questions, comments, and general ridicule.
Cheers,
Andrew Dupont
http://andrewdupont.net
I'm using TextMate 1.5 (906), and just starting to get involved with
a couple of Python projects. I watched the Python screencast by
Domenico Carbotta .. quite nice!
But there are a few snippets missing, I think. I'd like to use
for<tab> to build a for-loop template. Ditto for all the controls
like if, ifelse, while, and possibly a few others.
Are these in the Subversion repository? I tried to download the
entire bundle set from svn using the instructions on:
http://macromates.com/wiki/Main/SubversionCheckout
but it had an error.
So basically I'm looking for a bit more python help in TM but not
sure how to proceed.
Thanks!
-- Owen
Owen Densmore
http://backspaces.net - http://redfish.com - http://friam.org
>> In the regular find window, there's that arrow button you can click
>> to get a multi line text field where to enter your search query,
>> but I don't see it when I do a search in whole project, which is
>> kind of a pain when looking for lengthy pieces of code...
>
> Do you know command-E? It places the selection on the find clipboard.
> 99% of the time, I want to find something which is already in my
> source, and never actually type it in the find dialog text fields
Thanks for the tip. But the situation I'm often confronted to in my
job is editing whole sites coded by others that have the same exact
HTML on millions of pages and I really need to use the project wide
search and replace feature in order to be anywhere close to
productive... If there's is any chance to implement the same collapse
window thinggy from the regular search in the future, it would be
great. Thanks again for your help.
I didn't know about command + / till the other day, however i've run
into a minor issue.
If I have source like the following:
function do_me()
{
/* this was some old shit */
/*
$var = blah
*/
echo 'hello';
}
the command + / shortcut will turn it into:
/*function do_me()
{
/* this was some old shit */
/*
$var = blah
*/
echo 'hello';
}*/
which is deffinitly a no go. how could I change it so that it would
result in:
// function do_me()
// {
// /* this was some old shit */
// /*
// $var = blah
// */
//
// echo 'hello';
// }
Thanks,
Eric Coleman
I am (almost done) writing an HTML output script for my Lua bundle
which (among other things) provides TextMate links for syntax error
codes.
I put one of my files in a path with a space in the name, and it took
me a fair amount of experimenting to figure out how TextMate and Lua
independently wanted to see the URL.
The raw path as supplied in the argument list is:
/Users/gavinkistner/Desktop/pork butt/bling/tmp.lua
To pass that to Lua, I needed to escape the space char:
file_path = Pathname.new( ARGV[0].gsub( %r{([^\w/.])}, '\\\\\1' ) )
#=> /Users/gavinkistner/Desktop/pork\ butt/bling/tmp.lua
To create the parameter for the TextMate URL, I needed to NOT have
that escaping. If I perform HTML escaping (for valid HTML) the space
may not be represented as a '+' char, but must be a %20.
WORK:
<a href='txmt://open?url=file:///Users/gavinkistner/Desktop/pork butt/
orxit.lua&line=6'>
<a href='txmt://open?url=file%3A%2F%2F%2FUsers%2Fgavinkistner%
2FDesktop%2Fpork%20butt%2Forxit.lua&line=6'>
DON'T WORK:
<a href='txmt://open?url=file:///Users/gavinkistner/Desktop/pork\
butt/orxit.lua&line=6'>
<a href='txmt://open?url=file%3A%2F%2F%2FUsers%2Fgavinkistner%
2FDesktop%2Fpork+butt%2Forxit.lua&line=6'>
The Ruby code to create the valid URL param:
htmlpath = CGI.escape( "file://" + File.expand_path( path+file,
file_dir ).gsub( /\\(.)/, '\\1' ) ).gsub('+','%20')
As a more pathological case, I renamed the folder in Finder to "pork
\ % / butt"
The "/" in the name is apparently a ":" on the file system:
gavinkistner$ cd pork\ \\\ %\ \:\ butt/
gavinkistner$ pwd
/Users/gavinkistner/Desktop/pork \ % : butt
My code produces:
<a href='txmt://open?url=file%3A%2F%2F%2FUsers%2Fgavinkistner%
2FDesktop%2Fpork%20%5C%20%25%20%3A%20butt%2Forxit.lua&line=6'>
and it works. Yay! :)
In the regular find window, there's that arrow button you can click
to get a multi line text field where to enter your search query, but
I don't see it when I do a search in whole project, which is kind of
a pain when looking for lengthy pieces of code...
Did I miss something? Thanks!
Hello there
I just noticed that the new Mercurial bundle uses cmd-H to activate
its commands. I use this shortcut very often for hiding Textmate and
other applications. It's a system wide shortcut for hiding
applications. So I might not be the only one doing this. It's no big
problem for me since I can always disable the bundle with the filter.
All the same it might be a good idea to change it to anoter shortcut.
Cheers. Oliver
>I don't know if you use Growl but it's pretty versatile. You can
>choose the place where it pops up, the type of notif. (even speech or
>mail - not that useful for TM), the icon, how long it stays, etc. on
>per command basis (even over a network). So it can be used for notif.
>of background tasks as well for "instant feedback on the command
>executed".
Allan
I think you use this discussion list as a user feedback collection
point. In which case, FWIW, I would be very glad for Growl support too
for the reasons stated above. Growl is highly configurable, usable in a
persistent, immediate and coalesced modes and very OS X. I find
tooltips fiddly and non-persistent. I use most text at 14 points and I
find tooltips bothersome to read.
cheers
David.