On Sep 30, 2005, at 10:15 AM, textmate-request(a)lists.macromates.com
wrote:
>
> From: Allan Odgaard <allan(a)macromates.com>
> Date: September 30, 2005 10:14:31 AM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Re: Input from gets in Ruby (Sune Foldager)
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> On 30/09/2005, at 16.09, William M Shobe wrote:
>
>
>> I have tried using gets and no input dialog pops up. Here is my
>> code:
>>
>> puts "this is a test"
>> puts gets
>> puts "end of test"
>>
>> I use Run Ruby, and here is the output:
>>
>
> Works for me -- using latest build (http://get.textmate.org/):
>
> cmd N (new buffer)
> Paste previous 3 lines
> option-ctrl-shift R (switch to Ruby)
> cmd R (Run Ruby)
>
> And this is what I see:
>
>
> <pastedGraphic.png>
>
> Entering a string and pressing return outputs the strings and
> finishes the program.
>
>
The latest build works! Thank you.
Bill
PS When I download the latest build, there is a second file called
"mate". Is there something I need to do with this file?
I have tried using gets and no input dialog pops up. Here is my code:
puts "this is a test"
puts gets
puts "end of test"
I use Run Ruby, and here is the output:
this is a test
puts "this is a test"
end of test
Bill
> From: William M Shobe <shobe(a)virginia.edu>
> Date: September 29, 2005 10:28:59 AM EDT
> To: textmate(a)lists.macromates.com
> Subject: [TxMt] Input from gets in Ruby
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> Please excuse the simple question, but I am experimenting with
> TextMate and Ruby. The output from running a Ruby script goes to a
> stdout window. However, I can't figure out how to get input from
> the gets method. Is there any way to read from stdin when running
> a Ruby script from the Run Command>Ruby>Run Ruby menu?
>
> Thanks for any help.
>
> Bill Shobe
>
>
>
>
>
> From: Sune Foldager <cryo(a)cyanite.org>
> Date: September 29, 2005 12:08:58 PM EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Input from gets in Ruby
> <snip>
> Yes, this happens automatically, but stdin is redirected to read
> input from a dialog which should pop up whenever your script does a
> gets or similar.
>
> -- Sune.
>
>
> <snip>
>
> From: Sune Foldager <cryo(a)cyanite.org>
> Date: September 29, 2005 1:58:10 PM EDT
> To: Kumar McMillan <kumar.mcmillan(a)gmail.com>, TextMate users
> <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Input from gets in Ruby
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> On 29/09/2005, at 19.54, Kumar McMillan wrote:
>
>
>> oh, hehe, it is just the Run Ruby command. Sorry, I thought you
>> meant
>> this was built into TextMate!
>>
>
> Nope :-p, but it's built into the Run Python command also :-).
>
> -- Sune.
>
Please excuse the simple question, but I am experimenting with TextMate
and Ruby. The output from running a Ruby script goes to a stdout
window. However, I can't figure out how to get input from the gets
method. Is there any way to read from stdin when running a Ruby script
from the Run Command>Ruby>Run Ruby menu?
Thanks for any help.
Bill Shobe
I've started a very rudimentary TextMate language bundle for Django
templates (http://djangoproject.com). It's just a bunch of snippets
for tab-completion of the standard template tags and a very basic
language definition for syntax coloring.
I'm new to tmbundles, so everything is extremely basic and naive right
now, but if anybody out there is editing Django templates and using
TextMate, feel free to give it a whirl and let me know what does and
doesn't work. Suggestions or additions are welcome.
Grab the bundle here:
http://media.wilsonminer.com/images/django/Django.tmbundle.zip
When TM detects that a file with unsaved changes changed on disk, it
flies a warning panel. If the panel is not closed, but instead I
switch to another application and back to TM, it will fly another
panel. This can be repeated...
Also that panel should probably be modal to the window.
Gerd
Hi !
Thanks all for your answers. So I will look again at TM when it
reaches 1.3.
Just a few comments :
>> - I need some way to close XML tags automatically with the easyiest
>> possible keystroke. For some reason, the shortcut for this feature
>> does not work on my system (Tiger on iBook G4 and latest version of
>> TextMate)
>
> command-alt-shift-; (on a French keyboard) does not work?
> Seems to
> me that on my old B&W G3 under Tiger it works regardless of the
> kind of
> document edited in TM.
I confirm that this does not work on my system. What's strange about
that is that when I hit this keystroke, the "Automation" menu
actually blinks, as if one of its items was activated, but nothing
more happens. But when I select the item in the menu using the mouse,
it works... As far as I remember I saw in another thread that this
may be due to some kind of conflict with a LateX-related shortcut.
> I have never used an editor that indented soft-wrapped lines. I
> would think that would be annoying because the editor would control
> the indentation, not you.
I'm talking about *soft* wrapping, so this is just a matter of
display. For me this feature offers a very clear view of text-
oriented XML documents (see screenshot attached).
Best regards,
--
Frédérik Bilhaut
GREYC - Université de Caen
Campus II - Sciences 3 - Bureau 385
http://www.info.unicaen.fr/~fbilhaut
as of rev. 469, the custom $PATH var I export from ~/.bash_profile
does not show up in a command *if* the command has a shebang. I don't
know if this is intended behavior but I had a snippet with :
#!/bin/sh
at the top and $PATH was not set the same way it is when I leave off
the shebang and let TextMate parse the command through bin/sh. I only
added the shebang when trying to debug something so obviously the
workaround (for bash anyway) is to leave off the shebang.
K
Is there a way to do this that is easier than all this svn stuff? I
want to install whatever I need to get my color highlighting of code
(html, javascript, PHP) back.
After having spent two days completely rebuilding three machines (and
there is still more to do) in the studio I don't have the patience to
figure out how to get SVN to work again...sigh. Why can't I simply
download a file, put it into a directly...and voila. Like a plugin
or whatever...
Help...
Thanks, v
html macro start/end tag from previous word is absolutely wrong. May
this be because of the new regexp rules/features?
when applying it on div, i get
?1< />:<></>d?1<iv />:<iv></iv>?1< />:<></>
it worked with 1.17beta.
Andreas
I find this macro quite useful, but it has some quirks (I think).
First, I love how it takes img tags and makes them <img /> rather
than <img></img>.
When I apply it on a li-tag, and then hit enter, I get a nicely
formated line break with a tab indentation
<li>
|
</li>
but when I do the same on a h1 tag, the result becomes
<h1>
|</h1>
How, why, fix, please et cetera.
Andreas
Hi,
Congratulations for your TextMate software, I just switched to MacOS
and I have to say that it seems to be very good. JEdit seems to be
still ahead regarding features, but unfortunately it is almost
unusable for me under MacOS because it is too slow. So I'm very
interrested in TextMate, but it lacks several features I need.
Since it is payware, and because you may be interested in potential
users' requests, here is what prevents me from purchasing TextMate
for now :
- I use to write large documents in XML, and I use the soft wrapping
feature. But unfortunately the indentation is not properly handled in
this mode, since only the first "physical" line gets indented. You
probably now JEdit does that very well, I may send a screenshot if
you wish.
- I need some way to close XML tags automatically with the easyiest
possible keystroke. For some reason, the shortcut for this feature
does not work on my system (Tiger on iBook G4 and latest version of
TextMate). Also, I think that the JEdit way to do this is very good :
you just have to type "</" and the rest of the closing tag comes up
automatically. For me this is far more natural than typing an
arbitrary keystroke.
For me the lack of these two features above is a real show stopper.
Also, I have some less important feature requests :
- It seems that it is not possible to use tabs without creating a
project. It would be nice to have an option to say where newly open
files should be opened (in a tab or a new window).
- I noticed that using the tabulation key when a block is selected
does not increment the block but simply deletes it. I assume that
there is another shortcut for this, but I think it would be much more
convenient to be able to use the tab key as for a single line, as
almost all good editors do.
- And of course, having the possibility to have a simple file browser
without creating a project would be great. By the way, it also seems
weird to me that the project explorer expands at the right of the
main window and not at the left, which is quite unusual under MacOS
and does not do well with window maximizing functions.
Thanks for your attention,
Best regards,
--
Frédérik Bilhaut
GREYC - Université de Caen
Campus II - Sciences 3 - Bureau 385
http://www.info.unicaen.fr/~fbilhaut
Hi all!
[For the impatient reader: Just some food for thought, no solution
given].
The discussion about remote projects made me think that ideally
Virtual File Systems (VFS) really do not belong into the editor,
rather they should be part of the OS. An example is the OS X webdavfs
[1], which allows to mount webdav servers with the Finder, or the
(poorly working and read only) ftp file system [2]. Something like
that for SFTP would be the ultimate solution.
Under linux there is an interesting project called Fuse [3], which
basically hooks a generic driver into the kernels VFS and
communicates with user-space file system 'modules' (the OS X webdavfs
works somewhat similar). Someone else recently wrote a driver for
FreeBSD [4] that allows to use the Fuse file system modules.
The problem is that the OS X VFS implementation seems to be rather
under-documented and auite the moving target [5]. It changed a lot
for Tiger. It has developed independent from FreeBSD, so porting the
FreeBSD Fuse driver is not at all trivial (lack of documentation
again not helping).
I briefly entertained a bridge that would make a remote sftp server
appear like a webdav server, allowing it to be mounted locally using
the webdavfs and without extra software on the server. While this is
relatively easy to do (at least compared to the alternatives), it has
one major back-draw: DAV [6] (complex [dare I say convoluted] as it
seems) does not support the notion of file permissions. And the
thought of making all files pushed to the server executable (or not
executable) is not very appealing.
The ftpfs [2] on OS X uses yet another approach: It presents itself
to the OS as an NFS server, and translates NFS to FTP. This may seem
like a convoluted approach (and it is), but has the advantage that it
can be completely implemented in user space, and the NFS protocol
encapsulates it from changes in the kernels VFS implementation. So
one could write a bridge/gateway program that serves NFS and
translates it to SFTP. Or (though I have not had a look at
feasibility) it might even be possible to make this Fuse compatible,
giving easy access to many of the file system modules available for
Fuse ([7], or makings of a RailsFS [8]). Sometimes I wish I wouldn't
have to work for food...
Gerd
[1] man mount_webdav
[2] man mount_ftp
[3] http://fuse.sourceforge.net/
[4] http://wikitest.freebsd.org/moin.cgi/FuseFilesystem
[5] http://developer.apple.com/qa/qa2001/qa1242.html
[6] http://www.webdav.org/
[7] http://fuse.sourceforge.net/filesystems.html
[8] http://redhanded.hobix.com/inspect/
railsfsAfterACoupleMinutesOfToolingWithFuseWhoa.html
Hello,
I haven't had a chance to follow all of the TextMate enhancements as
closely as I would like, but I thought that I saw something about
regexes being able to look back and forward now.
I edit a lot of python files that haven't been written with TextMate,
which means that lines inserted for spacing/formatting are completely
blank. It would be nice if the folding support for Python could
support files that weren't written in TextMate.
Is it possible with all of the regex changes lately that Python
folding support could now support this?
I don't think that just reformatting the file(s) in question will
help because the people writting the files use emacs and have the
contents of their buffer reformatted when they open the file and when
they write it out, they strip any spaces and tabs on blank lines.
Thanks for any information,
Jordan
When recording a macro with "Use selection for find" it seems to work
for the find clipboard bur not the replace clipboard.
___________________
Ben Jackson
Diretor de Desenvolvimento
ben(a)incomumdesign.com
http://www.incomumdesign.com
HI,
Is it yet, or will it be possible to get a item like this in
Safari->Services : "Edit page source in TextMate"?
Thanks,
--
Jo <W:00°04'37" ; N:47°15'36">
1....'....12.....'....24.....'....36.....'....48.....'....60.....'....72
I've started using tm_wait as my mutt editor, and have been working on
an email bundle to make editing mail easier in TextMate. I've finally
got automatic hard-wrapping working (I have a macro bound to <return>
that hands off the current paragraph to the 'par' wrapping utility; this
handles wrapping better than TM's "Reformat Paragraph" command). The
last thing I'd like to do to polish off the text-wrap is to set "Soft
wrap" on and adjust the wrap column whenever an email is opened.
Is there any way to do this? The soft wrap setting at least appears
to be stored on a per-window basis. I was thinking they would be
stashed in the file's metadata, but using the xattr tool (mentioned at
http://arstechnica.com/reviews/os/macosx-10.4.ars/7) shows that only
the caret location is saved. (Hmmm... I could use this to place the
cursor below the mail headers... but I digress.) I haven't seen mention
of "hooks" in TextMate for calling commands/macros, but maybe I just
haven't looked hard enough.
Suggestions are appreciated.
--
eric
So I'm lying here, just staring at the ceiling tiles.
And I'm thinking about what to think about
I use Version 1.1b17 and have the re-indent-preference activated.
When I have a text like this:
<table>
<tr>
<td></td>
</tr>
</table>
and copy the 3rd line (the _hole_ line) and paste it between the 3rd and
4th line, I get:
<table>
<tr>
<td></td>
<td></td>
</tr>
</table>
Instead I would rather expect:
<table>
<tr>
<td></td>
<td></td>
</tr>
</table>
This doesn't happen, if the line before has no starting td-tag.
Another problem: If you put the cursor between the starting and ending
td-tag and press return, you'll get this:
<table>
<tr>
<td>
(cursor here)
</td>
</tr>
</table>
However, I would expect the ending td-tag to be indented.
Hi -
I've been using TextMate for a short while to do a variety of
software development tasks. My day job involves mainframe
development, including developing and maintaining REXX Execs. As I
didn't see that anyone had done this before me, I've created a theme
and syntax highlighting bundle for it. The syntax highlighting is
working quite well - I'd personally say that it's about 95% there. At
this point, I've come up with some questions regarding themes (mine
I've called the-not-terribly-original "Mainframe")...
1) If themes are to syntax highlighting (a language) in the way that
CSS is to HTML, then why is there not a way to specify in the
language definition a specific theme to use? I want to use my
Mainframe only when doing REXX stuff (so far), and other themes when
doing say C for instance.
2) It would be easier to create and maintain themes if they were on
the Window menu as the Bundle Editor is. Having it buried under
Preferences -> Fonts & Colors is IMO odd.
3) Unlike a language definition which I could cut 'n' paste or even
cut 'n' email, where do user created themes reside? and how could I
export/import or cut 'n' paste one?
Thanks!
Brian Caldwell
Hi List,
I'm pretty sure this has come up before.
What's the best way of using TextMate to edit a remote project via
ftp or sftp? The OS X finder's ftp disk seems to be read-only, so
that's no good.
Any distilled wisdom?
Cheers,
Ian
Hi,
I'm new to the list, so pardon me if this has been asked and answered
already, but a cursory review of the archives didn't yield anything.
I've got a TextMate project file that covers a directory that has a
couple thousand files in it. Now, I don't necessarily need to edit
all these files, but they're in the tree, and I didn't think adding
the parent directory of that tree to the project would have any ill
effects. But, TextMate seems to be affected by this, since upon
opening this project, it consumes 100 MB of RAM. And, every time
focus is taken and restored to TextMate, I get to watch the beach
ball for 10-20 seconds (I assume so it can review the filesystem to
see if anything needs to be updated).
Are these known performance issues? Is there anything I can do about
it? I've tried setting up a project that only contains the
directories of files that I actually need to edit and it seems to be
much happier with that. But honestly, is there any reason why it
should be so slow with large projects?
Thanks,
Brad
Okay. I'm working on some syntax-highlighting and such for a language
which, effectively, has no strings. Or rather, no quoted strings:
everything is a string or a list or whatever, depending on its
context.
The problem? One of the most irritating things is when I type a ' or a
", it adds a doubled one there. I want to disable that for just one
language... but not all... because when i'm doing Python or C++
programming, I quite like that feature.
Is there anyway to do that?
Thanks!
--Ix
Hi there,
When I hit Control-Shift-L to wrap my selection into an (A href=...)
tag,
TextMate takes a beachball timeout of 40 (fourty!) seconds, and when
it returns the href-part is empty.
What's up, is it just me?
If so, is there another easy way to make links?
For reminders, I'm using tm 1.1b17, and this is the snippet content:
> <a href="${1:`
> # if the clipboard contains a single line, let's use that
> if [[ $(pbpaste|wc -l) -eq 0 ]]
> then pbpaste|sed 's/&/&/g'
> else echo http://site.com/
> fi
> `}">${TM_SELECTED_TEXT:Link text...}</a>
Looks fine to me, assuming there's a real shell behind. For
discussion let's say my clipboard contains two lines of code, i.e. it
isn't huge.
Peter
Hi folks
I really don't know how this works, so I can only describe it: Some
revisions ago I figured out how I could add my own syntax coloring
for a specific language by typing ctrl+shift+p. Like this, I could
add a special syntax coloring for bold text in my markdown files to
see bold text more easily. When I pushed ctrl+shift+p while the
cursor was on a word sandwiched between two asterisks like **so**, I
got the scope for this as a tooltip: markup.bold.markdown. I added a
new element in my theme in the preferences and set the scope to
markup.bold.markdown. It worked perfectly. All text marked up as
**bold** in my markdown files got formatted the way I defined it. --
To get to the point: Some revisions ago, this suddenly stopped
working. It still works for the markup.italic.markdown scope though.
Maybe somebody knows how to fix this? Thanks!!
btw. I'm using Version 1.1b17 (452) with the latest bundles.
Oliver
I tried to write an applescript that opens the source code of the
frontmost Safari window in TextMate (that what happens when you press
Cmd-Alt-U in Safari, but with TM instead of the internal viewer). So,
I asked in the IRC how to open a file in TextMate via Applescript. I
was told that TM does not support Applescript and I should curl the
source and open that via open -a instead.
Well, this would work, but for my simple purpose, it could be done
easier; I mean, we got the source already in Safari, so why start a
curl download?
After some try and error, I found out that the command line tool tm
is all I need:
-- Script start --
tell application "Safari"
set mySource to the source of document 1 as string
end tell
do shell script ("echo " & quoted form of mySource & " | /usr/local/
bin/tm -a")
-- Script end --
tm must be installed in /usr/local/bin to work in this script. This
echos the source code into a file in /tmp and opens it in TM. I
binded it to my Hotkey-App and open it via Cmd-Alt-U in Safari. Works
nice.
Aaron