I was trying to install the footnote plugin from syncPeople on Rails,
and nothing happened. Then I fiddled around a bit and detected that
Show Scope didn't work either. So I thought maybe there was a problem
with the path $TM_xxx variables (those are paths, mainly, right?). So
using appZapper I did a complete reinstall and I think I've put
everything in the standard place but still no luck, neither plugin
install nor showing of scope works. Any help? I have all bundles
activated and I've also activated the macros using the automation
menu so as to avoid any keyboard mistypings.
Andreas
I've been experiencing a problem in the otherwise excellent Textmate,
it's related to tab-completing a snippet within a tab completed
snippet, here's a simple example to illustrate my problem:
I have created a new text.html document and typed mailto<tab> to get
the mailto snippet, now in the href value I am attempting to insert
another snippet I've created which is a shortcut for my email
address, unfortunately it assumes the shortcut is the value for href,
then moves to the subject value.
I can understand why Textmate works this way, after all, why would
you want to insert a snippet in to a field which expects a literal
value, but ideally I would expect it to tab-complete the email
address, then another tab to move to the subject field.
Hi guys,
I seem to have somehow hosed my bundles or commands or something.
Lot's of things don't work such as CMD+/ for comments or CMD+RETURN
for end of line then return, etc.
Is there anyway I can get fresh default bundles? Or is there
something else I can do to fix these things?
Sean
:::: DataFly.Net ::::
Complete Web Services
http://www.datafly.net
I changed the foldingStartMarker to this:
'^.*\bfunction\s*([\$|\w]\w*\s*)?\([^\)]*\)(\s*\{[^\}]*)?\s*$';
The only reason is that now I can fold this funny-named prototype
function:
function $()
Anyway, if you want to commit this change...
I'm just now playing with TextMate for the first time and, of course,
had to futz with themes a bit to get to my preferred light-on-dark
kinda coding environment....
Question: How do you tell what scope is under the cursor?
I found that I really liked Vibrant Ink, but it lacked scope
definitions for Objective-C and some of the other modes I end up
dealing with. However, the built in Espresso Libre did a pretty good
job otherwise. Since copy/paste didn't work in the Prefs pane
(Feature! Feature!), I ended up copying the various random settings
elements from one plist to the other.
Being too lazy to actually sort out the dupes, I wrote a wee bit of
python (you'll need PyObjC) that rips through the resulting plist and
eliminates duplicate settings (names only).
http://svn.red-bean.com/bbum/trunk/hacques/TextMate/
It is dumb. It should normalize by scope. I should fix that.
Actually, it really is broken -- it really should normalize by
scope. Ah, well.. it'll limp along enough for now.
b.bum
Hi Folks
Let me begin by making clear that I'm not a programmer - I'm trying
out TextMate in HTML production, which may or may not be advisable. I
have been using TextWrangler for this purpose.
The problem I'm having is too much space is being inserted before and
after what is actually being copied and pasted, like at least a
couple of words length on each end. And that's making messy code.
I'm copying out of Dreamweaver and pasting into TextMate.
TextWrangler doesn't make this mistake. What am I not understanding?
I would prefer to use TextMate - text and code are easier to read and
the overall design of this app looks quite advanced to me. I might
use it for ActionScript in the future but I probably won't be using
90% of the features.
This app is not very accessible to non-programmers. Maybe that's how
you prefer it. Some beginning and mid-level tutorials and/or movies
would help a lot. The manual is more like a reference book, rather
than showing it in application. Just to say you might get better
adoption of this beautiful app with better teaching of it.
Kearney Buskirk
I downloaded the Prototype and Scriptaculous bundle from
http://encytemedia.com/blog/articles/2006/01/03/textmate-vibrant-ink-
theme-and-prototype-bundle
but it seems not to be working (yes, I have activated it)
I don't get any syntax highlightning from it in either html or js
files, and this is supposed to happen as far as I understand?
Andreas
I am a recent convert to TextMate, but for some reason (probably me
fooling around in the app) I no longer get any content to show up in
the Function/Symbol field down to the right in the editor for my PHP
and HTML files. Now I just want to restore the default settings for
such files - is this possible while still retaining my other
settings? If so, could someone point me in the right direction?
Cheers,
Egil
--
egil helland / it consultant (mcse, web technology)
web: ikon.as / egil.net mob: +47-91315555
My apologies if this has been asked before but I hadn't seen it...
Is there a way to use TextMate to View Source in Safari (or any
browser for that matter)? Gosh would this be handy, I have a safari
plugin that at least shows the source in color, but of course,
anything I can do in TextMate is better!
Thanks,
Ray
--
Raymond Brigleb, Needmore Designs
http://needmoredesigns.com/
Love the TODO bundle and use it everyday to keep track of several
projects. What I would like to do though is print out the HTML output
the bundle produces. In otherwards, use COMMAND-Ndto print the window.
Any suggestions?
Thanks
Robert
Hi,
I saw some old posts on the mailing list regarding the pause (several
seconds) that the user experiences when switching back to TextMate
from some other application when a project contains files mounted
over NFS. An fs_usage confirms that it probably is the 1000's of
fstat() calls that TextMate does when activated that is causing the
pause.
Is this due to be fixed anytime soon, and in the meantime, has anyone
found any workarounds for it?
Thanks,
Geraint.
I am writing a script to parse a binary file in ruby. According to
the documentation on the file format, the integers are in little-
endian format. When I take the script, read the appropriate part of
the file, then 'unpack' with 'V' (little-endian), I don't get the
right answer from the internal "Run script" command. I do get the
right answer if I change to unpack with 'N'. However, if run from
the command line against Apple Ruby (/usr/bin/ruby 1.8.2) or against
Ruby compiled with DarwinPorts (/opt/local/bin/ruby 1.8.4), I get the
appropriate result with 'V' (as I should).
This seems to be a bug to me, though I'm not sure I'm missing
something here. Can someone either confirm this is a bug, or
alternatively explain to me why things are behaving in this way.
-albert
Hey all,
from time to time TextMate wants my password in order to save a file
having the following perms :
-rwxr-xr-x 1 yvon yvon 591 Mar 12 10:19 run.rb
even after entering the correct pwd, i'm unable to save the file
thought i've found a workaround :
copy the content into the clipboard ;
close the file without saving ;
re-open the file ;
paste the clipboard within this file.
have you heard of such a behaviour ?
best,
Yvon
I am working on an macro in which the selected text will be filtered
through one command and then all the text after the selection will be
filtered through another command. After the first command is
finished, the transformed text is selected, and I need to deselect it
and put the caret immediately after it. I had thought that hitting
the right arrow key would do the trick, but found out [that doesn't
always work][1]. Is there a foolproof way of getting the caret to
land right after the selection?
And while I'm asking questions, two more:
1. Is there a way for a command to call a macro?
2. Can a macro be made to behave differently depending on whether
text is selected or not?
[1]: http://lists.macromates.com/pipermail/textmate/2006-March/
008901.html
--
Dr. Drang
Hello,
Yesterday I decided to give TeXniscope a try after watching the
screencasts from Haris (btw, great screencasts!)
I have a problem making TextMate using TeXniscope though. I have set
the TM_LATEX_VIEWER variable to TeXniscope, and in TeXniscope I have
set the editor command path to /usr/local/bin/mate and the editor
arguments to %file -l %line.
When I typeset the document, TeXniscope doesn't open at all and the log
window shows this message:
******************************************
Compiling LaTeX...
This is pdfeTeXk, Version 3.141592-1.20a-2.2 (Web2C 7.5.3)
Typesetting: ./test.tex
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
Typesetting: ./test.aux)
(/usr/local/teTeX/share/texmf.tetex/tex/context/base/supp-pdf.tex
Output written on test.pdf (1 page, 20593 bytes).
test.log
Success
2006-03-08 08:59:20.072 open[11309] LSOpenFromURLSpec() returned -10827
for application TeXniscope path /Users/geir/Desktop/test.pdf.
2006-03-08 08:59:20.074 open[11309] Couldn't open file:
/Users/geir/Desktop/test.pdf
******************************************
The document I'm trying here is a fresh document from the article
template.
Any idea of a solution for this?
(TeXniscope version 0.3.4, and TextMate version 1.5(906))
--
Mvh/Regards
Geir-Tore Lindsve
lindsve(a)bluezone.no
http://privat.bluezone.no/lindsve
Hi all,
I'd like to announce Keyref, a little app for turning TextMate's
keyboard shortcut list into a PDF reference card. Go to http://
keyref.octopod.info and follow the instructions to generate your own.
You can choose up to eight of the bundles you have installed to add
to the card and generate as many as you want.
I built this because I switched to TextMate just over a month ago and
found myself very lost initially. Several people found the first card
I generated useful so I decided other people might and ended up with
the web app. It takes the shortcut list TextMate generates, so will
include all your own shortcuts as well as the standard ones.
If you find this useful, or have any problems, please let me know.
Cheers,
Chris
http://keyref.octopod.info
Hi all,
I get this error message with some commands launched by plugins :
- the TDDMATE commands
- the external syncPEOPLE on Rail commands
(ex: rake migrate)
- ..
AFAIK, my config is standard (PowerBook, Locomotive, EdgeRails, rake 0.7.0)
Any idea?
Alain
On various Windows editrors I can use Cltr+[ to jump beetween mathching
pairs of braces and parens.
Is there such function in TM? I haven't found it in menu and built-in help.
BTW: is it possible to re-assign Cmd+[ to tab? (only if some text is
selected, ofcourse)
--
regards, porneL
Hey all,
i'd like using, from TextMate, ruby scripts making use of :
require 'xml/libxml'
for the time being i get an error :
LoadError: no such file to load -- xml/libxml
i think i could be coming from $LOAD_PATH (for ruby) not set-up
correctly.
i did a ~/.MacOSX/environment.plist
with only the PATH assigned.
does i need to add something equivalent to :
export RUBYOPT=-rrubygems
export GEM_HOME=/opt/local/lib/ruby/gems/1.8
being in my zsh init.
or all of those kind of setup could be done thru TextMate setup, but
how ?
obviously my script making use of libxml binder is working from
terminal.
best,
Yvon
Hi,
when i tried to run generic complete in a latex file (to complete a
\ref) I get the following inserted,
\ref{/bin/bash: line 1: /Macros/LaTeXcomplete.pl: No such file or
directory
}
can anyone help?
many thanks
Jeff
I'm interested if there is a way or technique (or even "trick") that
will allow me to track and resolve naming dependencies in a TextMate
project.
Specifically, I'm thinking of the situation where, as I develop a web
site, I decide that I need to move or rename an existing file. In
order to prevent the website from breaking, I must then locate and
change any and all references to that file in ALL of the files in the
project. I can use Find and Replace in Project to accomplish that,
but this is hardly proactive on the part of TextMate. I have to stop
to do it, or *remember* to do it later.
If I were using GoLive or Dreamweaver I assume that if I changed the
name of a file in a project, I'd get a message that that file was
referenced in "X" number of files and would I like to update all
those files to reflect the new name?
Is there any way now (or might there be any way in the future) to
handle this situation?
I'm not programming in C or the like, but it seems to me that a
similar situation could occur there: Say that for some reason you
change the name of an include or header file... you'll be into a real
mess if you don't detect all the locations in the code where that
file is referenced and change it! OR... if you change a variable
name for some reason, references to that name will need to be changed
(even though we aren't changing a FILE name in that case).
Thanks,
eo
Greetings all,
I'm getting this: interpreter failed: No such file or directory
When using cmd-/ to add comments.
It's happening in various language formats.
I've tried some of the ruby path type solutions, but I'm not having any
luck.
Could someone point in the right direction to investigate this.
Dan J.
=======================
Daniel Jewett
Solid Ether
22 Church St.
Tarrytown, NY 10591
ph: (914) 332-7513
dan(a)solidether.net
http://www.solidether.net
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.
Hi,
Is there any way to replace tool tip output with Growl[1] for the svn
bundle?
Tool tips are the only "non-sticky" output, but they are so non-
sticky that I sometimes cant read them at all. If the cursor is not
at the right place (99% of the time as I use a tablet pen), this is a
real nightmare.
I can't find a way to catch the output of the command, if I could I'd
send it to Growl thru growlnotify (Shell) or Ruby-Growl.
So my questions are:
1) How can I catch the output of svn commands?
2) More generally, wouldn't it be nice to add Growl to the output
options? What do you think Allan?
For those who don't know it:
Growl is a central notification system for Mac OS X.
It's free and released under BSD license.
What is nice is that you can configure how notifications will look,
if they are sticky, etc. per applications. Applications can access it
through Cocoa and Carbon API or Applescript, Ruby, Perl, Java, TCL,
Python, Shell, etc.
Here are some scrennshots[2] and the huge list of apps using Growl[3]
[1]: http://growl.info/
[2]: http://growl.info/screenshots.php
[3]: http://growl.info/applications.php
--
FredB
I'm interested how it would be possible to create an autocompletion
plugin/bundle for Textmate and ruby. I realize there is ESC, but I
would like to open a menu with say CTRL-SPACE and then see all the
possible completions based on the entered characters. Then when I
continue typing in the editor, the menu adjusts it's contents to show
only the matching entries. The user can navigate the menu and choose
an entry to be inserted in the editor. Like auto completion in
eclipse, Visual Studio or XCode.
I found this article:
http://macromates.com/blog/archives/2005/06/09/code-sense/ and wonder
what the actual state of code sense is in Textmate. Is it possible to
create a Plugin/Bundle that controls an auto completion menu?
Ruben
I am new to TextMate. I have a bunch of lines and I am trying to sort
them. I select them and use the Actions popup and choose Sort from
the menu choices under Text, the text to be sorted disappears.
I tried to run the Sort command through the Filter through command
and got the same result. Empty document.
I am sure that my newbieness is showing through but can somebody
please figure out what exactly is wrong?
Indro
I take class notes on my laptop in Markdown and organize them in a
locally-hosted blog. Last week was the first week I used TextMate
instead of BBEdit for this, and I was occassionaly getting an extra
level of indentation while typing in code blocks. For example, in one
section of my notes I typed this:
| #include<vector>
|
| vector<int> v; // vector of zero elements
| vector<int> v(250); // vector of 250 elements, initialized to zero
| vector<time24> t(10); // 10 elements, all set to 00:00
Each line is indented by four spaces (the pipe characters are meant to
represent the left margin), which Markdown will wrap in <pre> and
<code> tags. I have TM (version 1.5 [906]) set to use soft tabs of 2
characters each.
I found that hitting the Return key after each of these lines (other
than the blank one) would put the cursor on the next line with an
indentation of 6 spaces instead of 4. This may be a red herring, but
the extra indentation seemed to occur only after lines that had an
angle-bracked pair, like <xxx>, in them. So in this excerpt
| #include<iostream>
| #include<vector>
| #include "d_random.h"
| using namespace std;
the extra indentation occurred after the first two lines, but not
after the second two.
Can anyone tell me why this is happening and what I can do to fix it?
--
Dr. Drang
Hi all,
I have come across an interesting conundrum that I wonder if anyone
else has dealt with.
(it goes without saying that I am now a tm fanatic and don't know how
I lived without it).
I am starting to work with Symforny -- a php5 framework. I have a tm
project for my sf project, but have discovered that the existence of
the ._files is interfering with the execution of the symfony command
(ie it sees ._schema..xml as "empty" and does not use the correct
schema.xml file).
I found 19.4 in the manual, and I want to know if that is my only
option -- I would rather not sacrifice metadata.
Thanks,
--
dc
-----
David Clark
Web Specialist
Institute for Community Inclusion (http://www.communityinclusion.org/)
david.clark(a)umb.edu
(617) 287-4318
Hi -
Using TM v.1.5 (906), I selected Terminal Usage... from the Help menu. I
got a message window titled "Enhanced Terminal Usage" which explained
about the shell command "mate" and asked where to create a symlink. I
left the default location as /usr/bin and clicked then "Create Link"
button. The standard admin user authentication box pops up, I enter the
secret password. Then I get a error message box that says:
Couldn't Create Link
Creating the link "/usr/bin/mate" failed with the following reason:
Operation not permitted
Hmmm. I check to see if mate is in /bin. Nope. Okay let's check /usr/
bin. Ahh a symlink but not a valid one. The link is /Users/aurora/
Desktop/TextMate.app/Contents/Resources/mate. The correct link should
be /Users/aurora/Desktop/TextMate/TextMate.app/Contents/Resources/mate.
Which in turn is a symlink to ../SharedSupport/Support/bin/mate where it
truly is. So, I deleted the bad symlink at /usr/bin and recreated it
properly. After a rehash, where mate shows it at /usr/bin/mate. And mate
-h returns help as it should.
Conclusion: whatever process or command within Textmate that created the
original (bad) symlink in /usr/bin needs to get tweaked to add the
TextMate bundle (Textmate) into the source file name. The Textmate app
name (TextMate.app) is fine, but both are needed.
Hope this helps,
Brian Caldwell
A very minor issue, but if I use the symbol transform to place a \n
in the output for the symbol, TextMate insta-quits when I load up a
file using that language.
The specific example that crashes for me:
{ showInSymbolList = 1;
symbolTransformation = '
s/([a-zA-Z_.:]+)[.:]([a-zA-Z_]\w*)/$1\n $2/g
';
}
Like I say, very, very minor - I would have been surprised if the
symbol had actually displayed on multiple lines.
Hello,
I've committed a working version of my Mercurial bundle to the Svn
repository. There may be some rough edges (like troubles if hg is not in
your PATH) but I'll fix these soon.
Thanks to the Darcs/SVN bundles authors for inspiration. :)
Enjoy!
--
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto(a)keltia.freenix.fr
Darwin snuadh.freenix.org Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005
Hi,
I frequently need to do a complete compilation, i.e. latex, bibtex,
latex, latex to update the references in the document - Using
existing bundles, latex+view, bibdesk, latex+view, latex+view I need
to click away upcoming error messages and Texniscope several times
throughout such a procedure. Has anyone a more elegant solution ? I
have to admit that my scripting abilities are not sufficient to make
my own bundle that could do that.
Christof
Hello,
I just have one suggestion for your otherwise beautiful text editing. Can
you please make code folding to display also an end tag of the block. Now
when the code is folded I can see "if {..." but the end tag is not visible.
I think it should display even the terminating "}", like "if {...}" or
"<hr>...</hr>".
Not seeing the terminating tag makes the document with folded code simply
unreadable, especially if the document is big and there is lots of code
folded. I am always searching for where the end of my block was gone.
Maybe it is only me, but I found it very confusing. Can you please fix/adapt
it? And if it's only me, it would be nice to have preferences for it, only
for me :)
Thanks,
Daniel
I really like the TODO bundle... however, something I think might be
useful.
I want to export the todo list to a file called "TODO" in the root
directory of the project. How can I accomplish this?
Eric Coleman
I'm trying to play with symbol list definitions, and things aren't
working for me.
I've created a language to play with:
{ scopeName = 'source.gk';
fileTypes = ( 'gk' );
patterns = (
{ name = 'heading';
match = '^((=+) (.+) \2)\s*$';
captures =
{ 1 = { name = 'heading.gk'; };
2 = { name = 'heading.depth'; };
3 = { name = 'heading.title'; };
};
},
);
}
And a source file that matches it:
= Heading 1 =
== Heading 1.1 ==
It's the end of the world as we know it, and I feel fine.
* And this
* Is wh a...z t I mean
...and there we go
== Heading 1.2 ==
= Heading 2 =
Using colorings in my own Theme, I can tell that the scope "source.gk
heading.gk" is being applied to the headings. Now I want them to show
up in the symbol list.
I've created a new Preferences part in the bundle:
/* preferences */
{ showInSymbolList = 1; }
and set the scope for that Preference to "source.gk heading.gk".
Unfortunately, nothing shows up in the Symbol list.
If I quit and restart TextMate, the contents of the Preference are
unchanged. (I noticed that if I put bad syntax into this preference
and quit/restart, the change doesn't stick. It would be nice if there
was a better way to "Test" if the preference is valid or not.)
I'm using Version 1.5 (906) under MacOS X 10.4.5. I can send a full
dump from System Profiler if the above does not explain why symbols
aren't working for me.
I've been using the TODO bundle and find it useful. Thanks.
Note that a checkout of the TODO bundle (from the repository) also
> require a checkout of the Support directory.
>
Uh, sure. I have Subversion and can update the bundles in
/Library/Application Support/... but how do I check out part of the app?
>From where? To where?
A little help for a Subversion novice would be appreciated.
Hi
The updated TODO works very nicely on osX 10.4 (my computer at home).
However, at work im using osX 10.3.9 (still waiting for the upgrade!).
I updated the bundles this morning and now when I run TODO I get:
/Library/Application Support/TextMate/Support/lib/textmate.rb:3:in
`require': No such file to load --
set (LoadError) from /Library/Application
Support/TextMate/Support/lib/textmate.rb:3 from /tmp/
temp_textmate.3IDEea:3:in `require' from /tmp/temp_textmate.3IDEea:3
Anyone got any ideas?
Stephen
Hey Allan,
Did you see that TM is recommended fo RoR development on ADC?
http://developer.apple.com/tools/rubyonrails.html
"Finally, we recommend that you download and install the 30-day trial
of TextMate to use throughout this tutorial. It's the editor of
choice for Rails developers on Mac OS X."
Nice.
--
FredB
I have started making use of the 'Run Script' feature for ruby files I'm
editing. All works fine and then I start to get this error:
/Applications/Tools/TextMate/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tm bundle/Support/tmruby.rb:115:in `sub': wrong argument type nil
(expected Regexp) (TypeError) from
/Applications/Tools/TextMate/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tm bundle/Support/tmruby.rb:115
Quitting and restarting TM bypasses the problem, but it would be good to
have it fixed! I'm on OS X 10.4.5, I'm willing to provide more info if
that helps...
Thanks in advance
- Jonathan
>From: Charilaos Skiadas <cskiadas(a)uchicago.edu>
>> Any insight greatly appreciated (and apologies if this is an
>> inappropriate post for the forum)
>
>I'd say it's very appropriate for the forum. The problem is I think
>that TextMate does not do multiline matching in the syntax, so none
>of these is going to work I'm afraid. Can't see a way out of this,
>unless of course you have the luxury of placing an empty line before
>the next >, and then matching that in foldingStopMarker.
>
>Haris
>From: Timothy Bates <timothy.c.bates(a)gmail.com>
>I had exactly this problem without output from our matrix package.
>
>My solution was to pre-process the output with a find-replace macro.
>
>The macro finds the taglines, and replaces them with "end\n($1)"
>
>That way, each block is wrapped in <tagline>...<end>
>
>Then the folding is trivial.
Thanks to both Haris and Timothy for replying so quickly to this....I
guess not having multiline matching in the syntax explains
it...thought I was going nuts!
The workaround as suggested by both was to preprocess the sequence
files (iterating over the entries using simple BioPerl - I'm pulling
the data on the fly from a RDMS anyway) and add a tab to the end of
each FASTA record...this tab is both invisible and unique to the end
of each entry and everything collapses as I want...
BTW, not only is TextMate amazing for programming/markup etc, it is
also awesome for bioinformatics analysis...I use v. large genome
datasets (flat file and RDMS) with scripting the primary mechanism of
retrieving/analyzing the data...I used to use NEdit but have ported
everything over to TextMate...using column selection, I can push
fields (like sets of gene names) as input to perl/shell scripts that
query the db and return the data formatted and highlighted...am
finding new stuff to do with it every day...
This patch fixes a problem with the Perl syntax where if you have a
function called 'submit', each call will appear as a function
declaration (sub mit).
Index: Bundles/Perl.tmbundle/Syntaxes/Perl.plist
===================================================================
--- Bundles/Perl.tmbundle/Syntaxes/Perl.plist (revision 2795)
+++ Bundles/Perl.tmbundle/Syntaxes/Perl.plist (working copy)
@@ -99,7 +99,7 @@
</dict>
</dict>
<key>match</key>
- <string>^\s*(sub)\s*([-a-zA-Z0-9_]+)\s*(?:\((.*?)\))?</string>
+ <string>^\s*(sub)\s+([-a-zA-Z0-9_]+)\s*(?:\((.*?)\))?</string>
<key>name</key>
<string>meta.function.perl</string>
</dict>
--
pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
-----Original Message-----
From: "Benoit Gagnon"<b.gagnon(a)gmail.com>
Sent: 25/02/2006 07:49:51
To: "TextMate users"<textmate(a)lists.macromates.com>
Cc:
Subject: Re: [TxMt] TODO List
On Feb 25, 2006, at 2:28 AM, Soryu wrote:
> Hi,
>
> in an attempt to do some ruby I have revamped the TODO list command
> again, completely. It's now written in Ruby using ERB with a template.
>
> It removes a bug from the older TODO comment which would descend
> into subdirectories for non-project files. So if you had a file
> in / and invoked the TODO command it would scan your complete Volume.
> It sorts according to TODO/FIXME/CHANGED categories
> and numbers the items, so you see how much work there is still
> todo :)
>
> Soryu.
Looks nice with a single file open, but fails with a "too many open
files" error with my entire project open.
Here's the error:
/tmp/temp_textmate.mqBVat:12:in `pwd': Too many open files - getcwd
(Errno::EMFILE) from /tmp/temp_textmate.mqBVat:12:in `scan_file'
from /tmp/temp_textmate.mqBVat:27:in `scan_file' from /tmp/
temp_textmate.mqBVat:26:in `each' from /tmp/temp_textmate.mqBVat:
26:in `scan_file' from /tmp/temp_textmate.mqBVat:27:in `scan_file'
from /tmp/temp_textmate.mqBVat:26:in `each' from /tmp/
temp_textmate.mqBVat:26:in `scan_file' from /tmp/temp_textmate.mqBVat:
27:in `scan_file' ... 7 levels... from /tmp/temp_textmate.mqBVat:
26:in `scan_file' from /tmp/temp_textmate.mqBVat:39 from /tmp/
temp_textmate.mqBVat:38:in `each' from /tmp/temp_textmate.mqBVat:38
______________________________________________________________________
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,
This is not a TextMate problem...rather a user issue but would
appreciate any advice...
I'm trying to set up folding...the file format look like this (FASTA
DNA sequence format) -
>text
agagagtttttttttt...(typically 60chars)
...multiple lines of above, number of lines varies per record
>text2
agagagtcgtttta
.
.
.
Setting foldingStartMarker is easy i.e; (^>) but it's
foldingStopMarker whcih is proving to be tricky.
As I see it, need to match the last line immediately before a new
entry denoted by ^> .
I figure a look-ahead assertion regex is required...something like -
[AGTCagtc]+ # match any string of ACGT
(?=\n^>) # positive look ahead for new line followed by >
But can't get this or numerous minor variants to work at all...
Any insight greatly appreciated (and apologies if this is an
inappropriate post for the forum)
First of all, I love TextMate. It's worth the price of a Mac just to
have such an awesome editor at one's disposal.
With that said, I have a feature request. ;-)
It would be nice if the function dropdown could be relocated to the
top of the window. CodeWarrior had its function dropdown up at the
top. BBEdit has it up there and XCode has it up at the top too.
It's more familiar to have it at the top. Second, and more
importantly to me, having it at the bottom often causes me to
overshoot with my mouse and end up in dock territory. If you have
dock magnification turned on, then you know what happens next.
It would be nice to have a configurable layout so that the UI widgets
could be tailored to one's individual preferences.
Charles Laine
claine(a)mac.com
The day Microsoft makes a product that doesn't suck is the day they
make a vacuum cleaner.
Hi there,
I'm posting here because I don't know if this has to be classified as
a bug and/or if someone has a possible solution for me....
Whenever I'm pressing the "filetype" switchbar at the bottom of the
screen, TM crashes. The weird part is, it worked allright before.
I tried switching to another local user. Textmate didn't crash while
at the other users account. I thought it had something todo with the
usersettings, so I tried deleting the com.macromates.textmate.plist
file from the ~/Preferences folder. To no avail.
Does anyone know what i could try next to get things running smoothly again ?
Thanks in advance,
Max
--
http://DLmax.org
On Feb 25, 2006, at 10:29 AM, textmate-request(a)lists.macromates.com
wrote:
> You don't need to use a webserver to run PHP. It comes with a
> standalone command line app, rightfully called "php". It will take
> stdin, output to stdout, and do all these things you cannot do in a
> web server / client browser scenario.
>
> ben
That sounds really great, I wish I knew how to do that.
This might be a dumb question, but is there ANY elegant solution for
keeping my Subversion repository in sync with my local files
*including* adding files, deleting files, renaming files? I'm really
trying to get religious about keeping all my projects under version
control, but I find it such a pain in the arse to have to remember to
do svn add, svn delete, svn rename whenever I decide to reorganize my
project files. In every project I do, I always get to a point about
halfway in where I say -- okay, this is messy -- let's combine these
files, delete this one, and rename these more descriptively. Then my
SVN repository gets all out of whack and refuses to let me make
anymore commits, and that's the end of version control for that
project. Happens every time.
Ideally:
It would be so nice if I could sync my TM project to my SVN
repository directly. If I rename something in the drawer, it gets
renamed in the repository too. Delete files? Add files? Same
thing. Is there some way to do this already? If not, how do you
guys handle this issue? And if not, any chance of adding this
functionality in a future release? Could a bundle be created to do
this?
Sean
:::: DataFly.Net ::::
Complete Web Services
http://www.datafly.net
Hi,
in an attempt to do some ruby I have revamped the TODO list command
again, completely. It's now written in Ruby using ERB with a template.
• It removes a bug from the older TODO comment which would descend
into subdirectories for non-project files. So if you had a file in /
and invoked the TODO command it would scan your complete Volume.
• It sorts according to TODO/FIXME/CHANGED categories
• and numbers the items, so you see how much work there is still todo :)
Soryu.
One thing I liked about vim was the continuation of the "*" down the
same column for each line in a block comment. So something entered
like:
(* Hello!
Blah
would be formated to:
(* Hello!
* Blah
I implemented this in the O'Caml language by changing the block
comment language rule to:
{ name = 'comment.block.ocaml';
begin = '\((\*.*)\)?$';
end = '\*\)';
beginCaptures = { 1 = { name = 'comment.block.ocaml.begin'; }; };
},
And adding two snippets for the return key: One for the scope
comment.block.ocaml.begin that would return, space in, and add a "* ".
One for comment.block.ocaml that would only return and add a "* ".
Xefore I charge off and add this for C, is this the best way to
implement this feature? Or am I missing an easier way? I've attached
the two snippets and language syntax for O'Caml if anybody would like
to try ti.
--
-Corey O'Connor
Forgive the ignorance...
perl -pe '
s/"/\"/g;
'
This there any reason that the above wouldn't work? I'm guessing it
has to with the "-pe" options (which I know nothing about).
I'm working on a bundle command (see below) that converts a plain-
text document (screenplay) to a PHP file for conversion to PDF via
FPDF (http://www.fpdf.org). Everything is working just fine except
for two things I just can't figure out--for the record, this code was
given to me by Allen for an HTML conversion and I've repurposed it
for this.
The first problem I'm having is with the very last line of code. The
idea is to get safari to open the generated document in Safari and
process it as a web-page. Because $DST seems to output the file-path
I can't just have it open "http://localhost/example.php", which is
what I want. How do I do that? Is it in the manual, 'cause I missed
that part.
The second question is regarding the 19th line of code:
$this->Cell(5.5,.18," XXXX ",0,0,'L',0);
I want to know if there is a way to define the "XXXX" bit in the
document itself with something like:
$header = example
How would that be done?
Thanks in advance, you guys are really helping make this bundle kick
butt.
-------------------------------
# first figure out a name for the result
NAME="${TM_FILENAME:-untitled}"
BASENAME="${NAME%.*}"
DST="/Library/WebServer/Documents/$BASENAME"
# everything we output within { … } is written to the PHP file via
redirection (see line with the })
{
# first output PHP header
cat <<HEAD
<?php
require("fpdf/fpdf.php");
class PDF extends FPDF
{
//Page header
function Header()
{
//Move to the right
\$this->Cell(5.5,.18," XXXX ",0,0,'L',0);
//Title
\$this->Cell(.5,.18,\$this->PageNo(),0,2,'R',0);
\$this->ln(.32);
}
}
\$pdf=new PDF("P","in","Letter");
\$pdf->SetMargins(1.5,.5,1);
\$pdf->AddPage();
\$pdf->SetFont("Courier","",12);
HEAD
# then PHP body (converted from document)
perl -pe '
s/"/\\"/g; #escape quotes
s/\/\/(.*)\/\/|^\/\/(.*)//g; # strip out non-printing comments
s/^(\t{4})([^\t].*)$/\$pdf->Cell(2);\$pdf->MultiCell(0,.18,"$2",0,L,
0);/g; #characters
s/^(\t{3})([^\t].*)$/\$pdf->Cell(1.5);\$pdf->MultiCell(1.5,.18,"$2",
0,L,0);/g; #parenthetical
s/^(\t{2})([^\t].*)$/\$pdf->Cell(1);\$pdf->MultiCell(3.5,.18,"$2",
0,L,0);\$pdf->ln();/g; #dialogue
s/(\t{10})([^\t].*:)/\$pdf->Cell(4);\$pdf->MultiCell(2,.18,"$2");\
$pdf->ln();/g; #right-transitions
s/^\w+.{2,20}:\s*$/\$pdf->MultiCell(0,.18,"$&",0,L,0);\$pdf->ln();/
g; #left-transitions
s/^(\w|\.|\[|\-).*$/\$pdf->MultiCell(0,.18,"$&",0,L,0);\$pdf->ln();/
g; #paragraph
'
# and finally PHP footer
cat <<'TAIL'
$pdf->Output();
?>
TAIL
} >"$DST.php"
# open the generated PHP file in Safari
open -a Safari "$DST.php"
Dear List,
One of the most striking things to a new user is that the most
important part of the UI for textmate is a button a that is at the
_base_ of the window (v. unexpected) and that is the smallest part of
the UI. I'm quite sure I would not have realised its significance had
I not seen the Screencasts, and I know that people I've recently
introduced to Textmate have had the same problem. Is there any way it
could be made more obvious?
Best,
N.
What is the meaning of the "swallow" key for language rules? I
searched the archives, wiki and documentation but I couldn't find a
good definition. Did I miss something?
--
-Corey O'Connor
> I'm guessing you want it to replace all " with \", in which case
> you would want to escape the \, i.e. s/"/\\"/g
Yeah, I feel silly, that's just it.
And one of these days I'll tell you everything I want to do, I promise.
[There is a question in here... scrub through to the end!]
This is very interesting!
Clearly, folks have a range of different tasks they need to
accomplish and a range of different approaches for doing so.
In my case, what I'm currently doing is ridiculously simple compared
to what some on the list are doing: I'm just editing a small number
of files that make up "a website." I'm editing the files locally...
the files are on a hard drive in a box that's right under my desk.
But to complicate things, I want to be able to see how these files
appear when served from a REAL web server (not just opened from my
disk). Plus, I also want to know how they look from a Windows machine.
So... I've set up my next oldest computer (a G3) as a "server in my
closet." This is my "test" deployment location.
Of course, I also want to deploy the files on a (external) "staging"
server where my client(s) can check things out.
So, at minimum, I have stuff in three places that I (usually) want to
be the same. When I started using TextMate, I was concerned about
that lack of "ftp/sftp/ssh integration."
After I discovered and researched rsync (yes, consider me a newbie as
regards The Power of the Command Line) and TextMate bundles, I'm
suddenly no longer concerned about whether I can open a file "via
ftp" FROM WITHIN TextMate. Or save it back from TextMate "to" the
Internet.
On Feb 19, 2006, at 10:05 PM, Court K wrote, in part:
> <snip>
> I mean who actually is editing files that ARE NOT going to end up
> on the internet? ...
> <snip>
As other's have mentioned, this is not *quite* the universal
situation... for example, folks editing LaTeX are (I presume) mostly
expecting to see the result in print; folks using TextMate to write
screen plays are also (again, I presume) thinking in terms other than
"web deployment."
The files I am editing ARE intended to go directly for the Internet.
But still I feel no need for "built-in" ftp/sftp/ssh support in
TextMate. In part this is because I'm always working with the same
set of files and their location on the net is always the same. And
no one else is editing them other than me.
So my Question:
What are folks doing that makes them want to see built-in ftp/sftp/
ssh support in TextMate? One situation I can imagine is the desire/
need to open many arbitrary files that are located in many arbitrary
locations on the Internet. I don't have a good picture of when
anyone would be needing to do that though. Are people doing that?
For me, the files I want to edit are on my computer. Periodically
they need to be uploaded to the net, but my editing sessions don't
begin from copies that were on the net.
Just Curious! ;)
eo
As a follow-up to the discussions about remote file editing, I wanted
to throw another idea out there. First of all, I think the ideal
solution is to have Mac OS X mount a remote directory in the Finder,
and then access that directory from TextMate as if it were on a local
volume. (After all, providing file access is the operating system's
job; TextMate shouldn't have to implement special support for it.)
I mentioned WebDAV before, and for editing files on a web site, it's
usually the best solution. Unfortunately, accessing remote files
outside of the web server's control is very difficult, sometimes
impossible, with WebDAV. For those cases, I've been resorting to NFS,
which Mac OS X also supports natively. However, NFS has always been
buggy in my experience, at least when accessing it across the Internet.
Luckily, Mac users have a third option: the Apple Filing Protocol, or
AFP. Although it's becoming obsolete in favor of less proprietary
standards, it doesn't suffer from the weaknesses of WebDAV and NFS.
Namely, it's not bound to a web server, and it has no trouble
mounting remote directories over the Internet. I've been using it to
edit remote shell scripts in TextMate with no problems.
Setting up AFP is very easy if your host system is Linux and you have
admin rights. You simply install the netatalk package [1] and start
the AppleTalk daemon. For instance, if you're running Fedora Core:
yum install netatalk
service atalk start
After that, you simply go the Finder, choose Connect To Server, and
enter afp://myserver. You can then enter your user name and password
to mount your home directory. More info about configuring share
points and enabling secure authentication is in the netatalk
documentation.
Anyway, I just wanted to mention that option for those of you who
want remote file access without having to rely on a third-party
utility or wait for SFTP support to be built-in to TextMate.
Trevor
[1] http://netatalk.sourceforge.net/
Howdy y'all. Wooo doggies!
I know a lot of people have talked about this in the past, but...
If you want to use TextMate through FTP, you can still use a project
window with tabs.
#1 Open up your FTP add (I've used Cyberduck and Transmit)
#2 Open a document from your FTP program into TextMate (cmd-j in the
duck)
#3 Find the temp folder that your FTP app uses to save the files
you're editing (the duck uses /var/tmp/folders.503/TemporaryItems/ on
my system)
#4 Open that folder in TextMate
#5 Close any FTPd files you're currently working on
#6 Open a document from your FTP program into TextMate (cmd-j in the
duck)
Your temp editing FTP files should now pop up as new tabs in textmate.
For extra slickness, you can save this project, stick the .tmproj in
your dock or something and be ready to go at a moments notice !!!!
yee haw!!!!
Enjoy ;)
(this really shouldn't come as news to anyone, but it was fun to feel
like a big know-it-all for a few precious moments)
((back to cruel intellectual mediocrity))
Hi all,
Just put this together and thought I'd share:
$TM_SELECTED_TEXT`echo "$TM_SELECTED_TEXT"|ruby -00 -pe
"gsub(/([._]|\W)(?:
(x)|(y)|(X)|(Y)|(width)|(height)|(w)|(h)|(Width)|(Height))/) { \$1 +
(\$2 ? \"y\" : \$3 ? \"x\" : \$4 ? \"Y\" : \$5 ? \"X\" : \$6 ?
\"height\" : \$7 ? \"width\" : \$8 ? \"h\" : \$9 ? \"w\" : \$10 ?
\"Height\" : \$11 ? \"Width\" : \"\") }"`
It will take, for example, something like this:
var xMin = (this.trap_mc) ? this.target_mc._x - bounds.xMin : 0;
var xMax = (this.trap_mc) ? this.target_mc._x + this.target_mc._width +
(this.trap_mc._width - bounds.xMax);
And append this afterwards:
var yMin = (this.trap_mc) ? this.target_mc._y - bounds.yMin : 0;
var yMax = (this.trap_mc) ? this.target_mc._y + this.target_mc._height
+ (this.trap_mc._height - bounds.yMax);
This is something I do by hand like, maybe 10 or 20 times in a coding
session. Anyone else have some useful additions (or a more elegant
regexp)? ;)
- Ben
___________________
Ben Jackson
Diretor de Desenvolvimento
ben(a)incomumdesign.com
http://www.incomumdesign.com
Anybody know any commands in Textmate that can remove all extraneous
whitespace from a HTML document like BBEdit's Formatting->Compact function?
I checked the tidy documentation but couldn't find anything. Strange, I
thought Tidy would have that one.
Quinn
I'm getting a digest of the topics here and suddenly (about 2 days
ago) I started getting every message posted here listed twice (in a
row) in the digest. Any one else having this problem? Any suggestions?
— oliver taylor
ollieman.net
Dear TextMate Users,
I use TextMate to deal with LaTeX documents.
To create the German format for quotations i have to write "`foo bar
"' (you have to move your nose very close to the monitor to see the
2nd character after the " character).
If I type the first " character a 2nd one appears. That's fine. Then
I type the the ` character. It will be completed with an ' char. The
results looks like "`'" . This is not what I want.
I would like to type the first " and want to get an "`'". What can I do?
Regards
Tukaram
Is there a workaround for this issue ? The XCode Bundle will not find
the active target on its own and complains with a huge tooltip,
basically dumping the entire hash of possibilities.
Am I restricted to projects with a single target ?
thanks
Ben
> Try this
>
> #!/usr/bin/perl
> local $/; # put Perl in "slurp" mode
> $text = <>; # read in the whole file
> $text =~ s/(\s+)$//mg;
> $text =~ s{((INT\.|EXT\.|I/E\.|int\.|ext\.|i/e\.)\s.*)$}{***$1}mg;
> $text =~ s/^([A-Z].*[A-Z)])\n^(\(.*\))\n(.+)$/\n\t\t\t\t$1\n\t\t\t$2
> \n\t\t$3\n/mg;
> $text =~ s/^([A-Z]{2,}.*[A-Z)0-9])\n(.*)$/\n\t\t\t\t$1\n\t\t$2\n/mg;
> $text =~ s/^[*]{3}(.+)$/\n$1\n/mg;
> $text =~ s/^(.*(IN:|UP:|TO:))$/\n\t\t\t\t\t\t\t\t\t\t$1\n/mg;
> $text =~ s/^(\w+.*(\.|\?|\!|\"|\-))\n\w+.*(\.|\?|\!|\"|\-)$/\n$1/mg;
> print $text;
Wow, thanks Dr. Drang! That worked perfectly. I'll be releasing the
bundle soon, and i'll be sure to let you guys know.
hi.
is there any reason, why the enhanced TODO-command is in the rails-
bundle and not, say, in the source- or text- or the todo-bundle?
(other than syncPEOPLE using it for rails)
niko.
--
____________________________
niko dittmann <ni-di(a)web.de>
____________________________
I often use Comment Line (Command-/) to add and remove comments. I
noticed that if I have a shell script snippet like this:
# Comment
then Comment Line removes the comment. But if the snippet looks like
this:
#Comment
then Comment Line adds yet another comment ("# #Comment"). Is this a
bug? I checked the Ruby code for the command in the Bundle Editor but
I didn't see anything wrong.
Trevor
Here are 3 macros, 3 commands, and a small Ruby program that take the
DRY principle to another level while writing Rails migrations.
These snippets for creating a table, adding a column, and renaming a
column will add the opposite actions into self.down for you. I made a
30 second demo video so you can see them in action. You'll find all
this on my blog. The address is in my signature.
Hope some of you find this useful.
--
Sami Samhuri
http://sami.samhuri.net
I really like the project drawer and I always keep it on the left-hand
side. This is not a problem as long as I use a single window: textmate
opens it up in the same location as when I last closed it.
But if I open up another window (with a drawer), it is always opened
with the drawer on the right hand side. It's really annoying, because
(as far as I can tell) the only way to switch drawer sides is to move
the window to the right screen edge and then toggle it off and back on
again. This wastes quite a lot of time.
Is there a way to force left side drawers?
Steven Wittens
> #!/usr/bin/perl
> local $/; # put Perl in "slurp" mode
> $text = <>; # read in the whole file
> $text =~ s/^([A-Z ]+)\n(\(.+\))\n(.+)$/\n\n\t\t\t\t$1\n\t\t\t$2
> \n\n$3/mg;
> print $text;
Of all the solutions proposed here, this once seemed to work the
best. Thanks for the tip about processing the entire document in one go.
I ended up with the following:
#!/usr/bin/perl
local $/; # put Perl in "slurp" mode
$text = <>; # read in the whole file
$text =~ s/(\s+)$//mg;
$text =~ s/((INT.|EXT.|I\/E.|int.|ext.|i\/e.)\s.*)$/\*\*\*$1/mg;
$text =~ s/^([A-Z].*[A-Z \)])\n^(\(.*\))$\n(.+)$/\n\t\t\t\t$1\n\t\t\t
$2\n\t\t$3\n/mg;
$text =~ s/^[A-Z]{2,}.*[A-Z\)\d]$\n^(.*)$/\n\t\t\t\t$1\n\t\t$2\n/;
$text =~ s/^\*\*\*//mg;
$text =~ s/^(.*(IN:|UP:|TO:))$/\n\t\t\t\t\t\t\t\t\t\t$1\n/;
$text =~ s/^(\w+.*(\.|\?|\!|\"|\-))$\n^\w+.*(\.|\?|\!|\"|\-)$/\n$1/mg;
print $text;
...but it doesn't work at all. I'm guessing that it's something
obvious that I can't see, but in case it's not an explanation of what
I'm trying to do follows.
1. removes trailing whitespace at the end of a string (which is
common in the format I'm importing from.
2. appends three *'s to the beginning of what I'll call well-formed
sluglines so that step 4 doesn't apply to these are well.
3. finds a specific set of lines, a Character followed by
Parenthetical, followed by Dialoge. And formats it.
4. finds Character followed by Dialogue when there is no
Parenthetical, and formats it.
5. repairs the sluglines that were changed in step 2.
6. formats transitions.
7. formats regular paragraphs (this is a little funky, but it's my
fault).
I can do all these in the Find&Replace window, but I get nothing when
running this bundle command.
You can find a sample document to test the script on here: http://
ollieman.net/files/bundles/braveheart-sample-unformatted.txt
And you can find what the result should look like here: http://
ollieman.net/files/bundles/braveheart-sample-formatted.txt
Thanks again for all the help. This will allow we to switch full-time
from Final Draft to TextMate. Something I'm really looking forward to.
> this would not allow for commands that take the whole document as
> input and the current selection as output, and autocompletion
> thingies wouldn't work _that_ good, so considering this I'm on +1 for
> allan's proposal.
I think some minor changes to the wording of Allan's solution might
make it more readable. What about:
Output: [ Discard ]
[ Text ] and [ pop-up ]
[ Snippet ] and [ pop-up ]
[ HTML ]
[ Tool Tip ]
[ New Document ]
And then the pop-up showing for the Text and Snippet output options
have the folowing options:
and [ Replace Input ]
[ Replace Selection ]
[ Replace Document ]
[ Insert After Caret ]
This version uses more [action verbs][1], which makes it read more
logically.
> by the way, I'd like an option to show the output as a popup menu (or
> something like that): this would perfectly suit autocompletion. think
> about it, al.
I'll second that.
Nice ideas, Allan! Cheers,
Ben
[1]:
http://developer.apple.com/documentation/UserExperience/Conceptual/
OSXHIGuidelines/XHIGMenus/chapter_16_section_3.html#//apple_ref/doc/
uid/TP30000356-TPXREF117
___________________
Ben Jackson
Diretor de Desenvolvimento
ben(a)incomumdesign.com
http://www.incomumdesign.com
hello:)
TeXShop can provide synchronization in two ways.
"pdfsearch" : The default method uses a new ability in Mac OSX 10.4
to search for strings in pdf files.
No special style files need be included to use this method.
"pdfsync" is the original method but needs to add the following line
to the preamble of your tex source code before the \begin{document}
line:
\usepackage{pdfsync}.
Is it to possible to use in the future, the first method "pdfsearch"
with Textmate
Thanks
Alain