I have just discovered TextMate, and am so far very happy with it,
but I think I just hit a glitch...
I am trying to edit a SQL load file that is about 5M, which shouldn't
be a problem. However, some of the lines are very long, as a complete
website contents is in a single line. I have no idea how many
characters are in this line, but I suspect about 2M worth.
Anyway, TextMate hangs while trying to work with this file. I can't
do much at all. Even a simple act of scrolling hangs. TextEdit does a
reasonably good job with the file though...
Actually, I don't think it is hanging, as it eventually responds
(about 30 seconds later), but it is so slow that it is completely
unusable. Is this a known problem? For me, it is weird files like
this that we need an editor like TextMate to be able to easily handle.
Thanks...
Jim Leask
Hi Allan and friends,
I have a source tree structure like this:
www/
site/
index.tcl, .adp
one.tcl, .adp
edit.tcl, .adp
item/
index.tcl, .adp
one.tcl, .adp
edit.tcl, .adp
The fact that files are named the same, but in different directories:
- Confuses both the Cmd-Opt-Up "Go to Header/Source" feature, which
will gladly find www/item/one.adp when I'm editing www/site/one.tcl. It
would be good if it would prefer the file in the current directory when
one exists. Otherwise, it's a great feature.
- Similarly, when using Cmd-T "Go to file", which I use almost
exclusively to open up new files now, it would be great if I could
write "itemonetcl" to get item/one.tcl, as opposed to site/one.tcl.
Currently, it doesn't take the path into account at all.
I can see some downsides to changing current behavior, too,
particularly with the Go to file feature.
But let me know what you think.
/Lars
As I set up Reformat Comment commands for the languages I use most
frequently (LaTeX and R), it occurred to me that maybe there's a way
to make a single call to rubywrap more generic, so that we don't need
a command per bundle. This is the result:
#!/usr/bin/env ruby
$LOAD_PATH << "#{ENV["TM_SUPPORT_PATH"]}/lib"
require "escape"
scope = ENV["TM_SCOPE"]
case scope
when /comment\.(block|line)\.number-sign\./
cstring = "# "
when /comment\.(block|line)\.percentage\./
cstring = "% "
end
flags = ""
flags += " -p \"#{cstring}\" "
flags += " --retabify" if ENV["TM_SOFT_TABS"] == "NO"
text =`echo -n "#{e_as(STDIN.read).gsub(/[$`]/, '\\\\\0')}" | ruby "#
{ENV["TM_SUPPORT_PATH"]}/bin/rubywrap.rb" #{flags}`
print e_sn(text)
The parameters are the same as the current command, with the
exception of scope, which I set to "comment.line, comment.block".
I also added a gsub to the command because it was eating latex math
and R symbols ($). There's probably a better solution to that. This
seems to work for me, and should be extended easily by adding lines
to the case statement for other languages. One advantage is that by
specifying the comment character based on the scope, it ought to work
for anything; it catches comments for both bash and perl, for
instance, without any extra effort. I think it's kind of cool.
-Alan
I must be missing something really obvious here but I don't know how
to do this most basic thing:
(1) Drag a folder onto TM icon to open as project
(2) Open an HTML file called index.html
-- Now here's the part that throws me ---
(3) Make a new file called index2.html based on the original index.html
My first instinct is to right click on the file in the project drawer
and look for "duplicate file" or something similar - no such option
exists. So the next thing I try is opening the file and using "Save
as" to make the new file. This actually works but something weird
happens: In the drawer, it has the effect of *renaming* my original
file rather than adding a new one. If I switch to another
application and then back to TM, the original file reappears. Is
this expected behavior?
So what's the preferred method of creating a new file starting with a
copy of an existing one?
Thanks!
Sean
:::: DataFly.Net ::::
Complete Web Services
http://www.datafly.net
TextMate has a syntax element called "Embedded Source", which is used
for things like the lstlisting environment in LaTeX or JavaScript
code embedded in HTML. The default background color for this element
is a light blue, which is almost identical to the light blue used for
selected text. Because of the similarity, I always get confused and
think I've inadvertently selected some embedded source. I'm wondering
why there is such a similarity between these colors. Was it
deliberate (and if so, what was the reason?) or was this an oversight?
Trevor
Thanks for the feedback,
Danstan,
The only way I've been able to figure out to run selections is to save
the selection to a temporary file and run the temporary file. Alan
suggested saving the file in /temp/somthing.do, rather than in the
current working directory. I think that makes sense and will give it
a bid. I looked at the R bundle's implementation of running a
selection, and as best I could tell (not very well, granted) it relies
on some AppleScript that Stata doesn't recognize. Simply stealing the
R implementation was my first instinct, but I couldn't get it to work
(which doesn't mean, it can't work, just that I couldn't get it to
work).
Alan,
Thanks for the suggestions, I think I'll probably use both of them,
Tim
A typical problem is the bold command in the Latex bundle. Instead of
inserting "textbf{}", it inserts "env: ruby -s: No such file or
directory". The bold command seems to work if I replace the first line
in toggle_style.rb with "#!/usr/bin/ruby -s". (I have created a link
so that /usr/bin/ruby links to Ruby 1.8 installed from Fink.)
Will I break things if I change the first line of the various ruby
scripts from "#!/usr/bin/env ruby -s" to "#!/usr/bin/ruby -s"?
Thanks for your help,
Darryl
> On Sep 17, 2006, at 1:09 AM, Darryl Morrell wrote:
>
>> I recently acquired TextMate 1.5.3, and am overall very pleased with
>> it. However, I am running OS X 10.3.9, and several bundles do not
>> work correctly. In particular, several commands in the Latex and
>> TODO bundles do not work. Some of the problems were fixed by
>> installing Ruby 1.8 from Fink, but many others remain. Any help
>> would be appreciated.
>
> A lot of bundle commands require Ruby 1.8, and as far as I know that's
> the only problem with 10.3.9, so if there are still commands you can't
> run, then you should probably tell us what they are and what error
> messages you get.
>
>> Darryl Morrell
>>
>
> Haris
Hi all,
I was wondering if anyone has any suggestions as to how one might use
Textmate to interface with Matlab? I can have a command execute a given
.m file, but Matlab is a much heavier process to load than perl is from
the command line, so that becomes a very unattractive option.
Ideally I'd like to have Matlab running in a terminal (the java
interface is just too slow for me), and edit with Textmate in such a
way that commands could reach the already loaded session.
cheers,
-don
==========================
Don Kalar
Graduate Student,
Cognitive Neuroscience
UCLA Department of Psychology
1285 Franz Hall, Box 951563
Los Angeles, CA
90095-1563
==========================
Hi:
I am trying to write a simple osascript command-line utility that
acquires the directory of the file displayed in the frontmost
TextMate editor window, and am having trouble.
I've been trying to use applescript syntax such as this:
osascript<< END
tell application "TextMate"
activate
do shell script "echo $TM_DIRECTORY"
end tell
END
but the variable $TM_DIRECTORY is apparently empty.
Is there another way to accomplish this, with or without
applescripting? (I'd prefer a less pathological scripting language.)
Thanks.
Bill