Allan, Ciarán, all,
I used the phpdoc snippets a lot in TextMate. I also go back and add
to those phpdoc blocks. When I go back and edit those blocks TextMate
doesn't provide any help.
I created a command and snippet to help:
The Command provides Auto complete when you use a @ in a phpdoc comment.
The second file is a snippet for when you hit enter it puts an
asterisk at the start of the next line.
Timothy
I'm making some custom templates (among other things) for my favorite
languages, and I need some advice/best practices about them.
1. I heard that people are moving away from normal Templates and towards
Snippets for this purpose; is this correct?
2. One advantage I see with Snippets is that it lets me set the filename
(which I can then use) before calling the Snippet, which is not possible
with a Template unless I'm in a project. Is there some way around that with
Templates?
3. As I make these Templates, I'm finding a lot of common text between them,
and when I want to tweak it across the board...well, it's like programming
without functions. What, if anything, can I do to reduce redundancy in my
templates?
Thanks,
Neil.
In developing my bundle, I've been issuing feedback to the user with Create
New Document. Now that things are working decently, I want to switch to Show
As HTML. Here's the problem. Throughout my routines, when I want to issue
some feedback, I just say "puts". Now, however, using Show As HTML, I want
to wrap this in some way such that every time there is a "puts" I grab it,
shove a <br> on the end, and pass it along, so that my output appears
streaming into the HTML window as the script runs.
So, yeah, I could look thru all my code, find every "puts", and append the
<br> myself. But I don't want to. I want to just wrap up what I'm already
doing and perform the transformation as the input appears. There must be
some simple way to do this.
Here's what I have so far:
def self.perform(command_name, *args)
require "#{ENV["TM_SUPPORT_PATH"]}/lib/web_preview.rb"
STDOUT.sync = true
html_header(command_name.to_s)
puts "<pre>"
self.send(command_name, *args) # FIX ME
puts "</pre>"
html_footer()
end
It's that "self.send" line that I want to wrap up in some way so that I can
intercept the output from each "puts" within my routines and modify it.
Oh, and while we're up: is there a way I can detect whether we are currently
set to Create New Document or Show As HTML? I'd like to funnel all my
commands thru this one bottleneck but NOT do all that stuff if we are set to
Create New Document (in that case I just want to pass the output thru
untouched).
Thx! m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
Hi guys,
I just started using Textmate recently and at the moment I am trying to get
some Python scripts working with it. Everything works great but I was
wondering how to you pass command line arguments to a python script when you
run it?
Thanks
Regards
David
Ah ok thanks,
Although it might not be a bad idea to have a different meant to run
it by expanding the python bundle to "Run scripts with Arguments"
Thanks again for a possible solution.
Regards
Dave
On 9 Jul 2009, at 19:53, textmate-request(a)lists.macromates.com wrote:
> There is no support for this, it?s not that we don?t want to provide
> it, just that it?s not really feasible to do without bringing up a
> dialog and that would be a pain for the 99% where you don?t want to
> provide arguments.
>
> What you can do is simply read from stdin then TextMate will show a
> dialog, this is how I handle it in most of my scripts, i.e. read the
> arguments from stdin instead of command line options (when I know I
> mostly run the script in TM).
Hi,
Many of my Textmate commands are slow and take up to 15 seconds. My
problem seems to be the same than the one described in this thread:
http://lists.macromates.com/textmate/2006-January/007647.html. The top
command shows that the bash seems to be taking up all available CPU
cycles while TextMate is loading. This is really annoying, since this
happens with even very basic bundle commands like bolding in LaTeX,
which renders the commands in LaTeX bundle virtually unusable.
I tried the solution provided in this post:
http://lists.macromates.com/textmate/2006-January/007705.html. However,
I don't have fink or any other suspicious lines in my .bash_profile,
.bash_login or .profile files. Does anyone have any idea on what might
possibly cause the problem?
Regards,
Juho
--
Juho Makkonen
+358 41 5022 683
>> This is probably old news to everyone, but the scope of the quote
>> toggle did not include source. [...] I added 'source' to the scope
>> list and this fixed the "problem". I figure toggling quotes is
>> useful in any source location.
>The command is intended to be used without a selection, as it will
>work on the current scope, which is string.quoted.*.
>By adding ?source? to the scope selector you break it for when there
>is no selection (as it will then receive the entire source as stdin).
That will make my life loads easier. Now it works. I swear I tried that
before. Now that I see SOURCE in the source area of the bundle item.
Everything is clear. The Key
Equivalent won't work if you have the quotes selected though, or
anything selected. It
will work if you have the quote selected and you select the bundle item from
the menu. This is what sent me down the wrong path.
Thank you.
--
Brad Tittle
Tech Support
I am working in a project that has many folders corresponding to real
directories. After working for a while, there may be some folders
that are expanded and others that are collapsed. The thing is that if
I close the project and open it again later, then all of the folders
will be collapsed. This is very annoying because I must expand all
the folders I want access to every time I work on the project. Is
there a way for TextMate to maintain the state of which folders are
expanded and which are not the next time I open the project?
Hi Allan, Ciarán, all,
My projects frequently have a git root that is outside the project
directory, sometimes I even use source files from multiple projects/
repositories at the same time.
The appended patch to ProjectPlus allows the git module to handle that
correctly.
Seems the release notes and maybe version are updated by some utility,
so I did not touch them.
Gerd