I am trying to make a snippet for easy writing of Effective Uniform Annual
Worth calculations which look something like this: EUAW = (Yearly Benefit +
Salvage Value*[A/F, $5%, $6]) - (Yearly Cost + Initial Cost*[A/P, $10%,
$11]) = [same thing but with [] expressions replaced by table lookups i do
by hand]
This is the snippet I've crafted for this (and to learn how to use
conditionals in snippets in general):
EUAW($1) = (${2:Yearly Benefit}${3: + ${4:Salvage Value}[A/F, $5%, $6]}) -
(${7:Yearly Cost}${8: + ${9:Initial Cost}[A/P, $10%, $11]})
= ${14:($2${4/$|(.+)/(?1: + $1*0.)/}$12) - ($7${9/$|(.+)/(?1: +
$1*0.)/}$13)}
That fills in everything, with appropriate mirroring, with one exception. I
want the text that's inserted if Salvage Value or Initial Cost are not
removed to include a tab stop. Thus I want the last line to look, I think,
like:
= ${14:($2${4/$|(.+)/(?1: + $1*0.${12:Table Lookup Value})/}) -
($7${9/$|(.+)/(?1: + $1*0.${13: Table Lookup Value})/})}
So that way if the salvage value/initial cost fields are removed in the
first part of the equation, the tab stop won't be there, but otherwise it
will so I can fill in the table lookup value. However, I've tried about a
dozen things and I can't get it to put that tab stop there. I understand
that $12 in that context would refer to the regex subexpression 12, but I
have tried escaping all sorts of character combinations to prevent that to
no avail.
If someone could please tell me how to insert those conditional tab stops in
there, I would be most appreciative.
Thanks!
--
View this message in context: http://www.nabble.com/Inserting-Tab-Stops-inside-of-Conditional-Insertion-t…
Sent from the textmate users mailing list archive at Nabble.com.
Hello Allan,
I found this on the net today:
http://www.simplehelp.net/2008/04/24/how-to-blurminal-your-os-x-terminal/
Its a hack of the terminal via SIMBL giving transparent backgrounds of
Terminal a 'blur effect'.
For a certain degree 'blurring backgrounds' improve usability, instead
of being GUI-toy only.
Also, it would integrate well into GUI changes of OSX that came with
Leopard.
Could something similar be on the roadmap?
BTW: This 'blurring' effect could be accompanied (fo' tha freakanoidz)
by effects like 'invertation of the background', making it B/W or
applying textures to it.
And Im thinking these kinds of effects will be supported by Core
technology, having in mind that you stated TM2.0 will be absolutly
build on core libraries of OSX 10.5 Leopard :0)
Thanks in advance!
Dennis
ps: But I also have in mind that you dont think TM will have its own
background-images, so I consider that you dont put any priority on
these GUI things :0(
hello,
don't really know if it's a feature request, bug report or my stupidity:
if i have a project opened in textmate like this:
~/project_dir
a_file.txt
and i call 'mate a_file.txt' from inside the project_dir everything is
fine
(file opens as tab in project window). but if i call mate from another
directory
with an absolute or relative path to ~/project_dir/a_file.txt, it
opens in a new
window which is very unconvenient for me.
if there should be a reason (can't imagine one) against this proposal,
i could live
with a command line option to specify the project's directory.
thanks in advance for considering it,
yours kodi
Hey fellow textmates!
I'd really really like to replicate something like eclipse's ability to hit
tab to move outside parentheses. However, all I really want to do is be able
to hit tab to move from |) to )| outside parens, I don't really even need it
to work when the cursor isn't directly adjacent to the closing paren.
I know I can make ( trigger a snippet that does that, but then I lose all
the regular functionality. I thought perhaps one could define a scope
('within-parens') for all source code, and then there could be a command or
something that checks to see if the next char is a ) and if so advances the
cursor past it that'd only work in that scope.
More advanced functionality would be great but not really crucial. If anyone
could help with this I'd REALLY appreciate it!
Thanks!
Nicolas Artman
--
View this message in context: http://www.nabble.com/Using-tab-to-move-out-of-parentheses-%28like-eclipse%…
Sent from the textmate users mailing list archive at Nabble.com.
I've recently starting using mercurial (using v0.9.5), and am using
the Mercurial bundle (2 Aug 2007 version - the latest, I think).
Sometimes it works great, and sometimes an attempt to use it fails
with "abort: There is no Mercurial repository here (.hg not
found)!". I've searched the list archives, and found one reference
to this issue:
http://lists.macromates.com/pipermail/textmate/2007-November/023219.html
But I don't understand the discussion, nor how to apply it to my
project. How can I create a TextMate project that has files from
several different nested directories, without having the Mercurial
bundle fail to work?
Thanks,
--
Kevin Horton
Ottawa, Canada
I have written a command to "Reflow comments" in my Stata do files.
The command is as follows:
#!/usr/bin/env bash
sed -E -e 's_^\s*//(.*)_\1_' | # strip leading // and whitespace
from each line
fmt | # reflow comment text
sed -E -e 's_^(.*)_//\1_' # prefix each line with //
Input is set to "Selected Text" or "Scope", and output is set to
"Replace selected text".
If I invoke the command with the cursor in the middle of the following
comment:
// this is a profoundly silly comment that I'm writing just to test
out how to reflow comments
// something strange happens when I select the text rather than simply
execute it within the comment scope
// i wonder what's going on
// maybe i'll write to the mailing list
I get the desired output:
// this is a profoundly silly comment that I'm writing just to test
out how to
// reflow comments something strange happens when I select the text
rather
// than simply execute it within the comment scope i wonder what's
going on
// maybe i'll write to the mailing list
However, if I instead select the entire block of text, I get the
following mangled result:
// this is a profoundly silly comment that I'm writing just to test
out how to
reflow comments // something strange happens when I select the text
rather than
simply execute it within the comment scope // i wonder what's going
on // maybe
i'll write to the mailing list
Can anyone explain what causes the differing behavior?
Thanks!
Michael Manti
statboy3000(a)gmail.com
Trying out the ActionScript 3 bundle, and I get this error when I try
to build using mxmlc:
Loading configuration file: flex-config.xml
/Library/Application Support/TextMate/Bundles/ActionScript 3.tmbundle/
Support/bin/parse_mxmlc_out.rb:31:in `+': can't convert nil into
String (TypeError) from /Library/Application Support/TextMate/Bundles/
ActionScript 3.tmbundle/Support/bin/parse_mxmlc_out.rb:31 from /
Library/Application Support/TextMate/Bundles/ActionScript 3.tmbundle/
Support/bin/parse_mxmlc_out.rb:24:in `each' from /Library/Application
Support/TextMate/Bundles/ActionScript 3.tmbundle/Support/bin/
parse_mxmlc_out.rb:24
I can't figure out what's causing this. Any suggestions?
Hi!
At time I have no Mac as a laptop and therefore I use emacs when I'm
not in front of my iMac. I just found out that emacs has quite a
simple but cool outline-mode and wanted to ask if it is already ported
to TextMate. Does anybody know?
Niels
On Fri Apr 18, Kai von Fintel wrote:
> The minimal test case below shows that something in the parsing of the
> newenvironment command is throwing off the syntax coloring by the
> LaTeX bundle, at least on my system (TM 1.5.7 1464 on Leopard). The
> text in the document is incorrectly parsed as being in a math
> environment.
>
> \documentclass{article}
>
> \usepackage{amsmath}
>
> \newenvironment{choice}
> {\left\lbrace\begin{gathered}}
> {\end{gathered}\right\rbrace}
>
> \begin{document}
>
> Text incorrectly parsed as being in a math environment.
>
> \end{document}
>
> -----
>
> Any ideas of how to fix the parsing?
Hi Kai -- This isn't exactly the correct fix, but if you go to Bundles-
>Bundle Editor->Edit Languages... and pick the LaTeX->LaTeX syntax
definition, down about 1/3rd of the way down, you'll find the place
where it is looking for these mathy environments:
align|equation|eqnarray
| multline|aligned|alignat
| split|gather|gathered
soon below that, you'll find
end = '(?x)
(?:\s*) # Optional whitespace
If you change the (?:\s*) to (?:.*?) then you can get a sort of
approximation of the correct syntax coloring.
I really don't quite understand why it works, but the idea was
essentially to allow the { that precedes the \end{gathered} to be
ignored (it wouldn't have counted as whitespace). In the original
formulation, TextMate couldn't find the \end{gathered}, and so just
assumes that the environment ends when the document does.
This isn't actually the right solution, but it at least keeps you from
having the entire body of your document math-colored. The symptom of
why this isn't the right solution is that everything following
\begin{gathered} (including the closing brace of the first argument to
\newenvironment, as well as anything from then on until just before
the line containing \end{gathered}) is math colored.
Ideally, the LaTeX bundle would be able to handle \(re)newenvironment
specially, since each of the two arguments to these commands will
almost always contain a lone \begin or \end, and scope of any
mathification should presumably be restricted to the argument itself.
But I haven't got a clue how to approach this the "right" way.
-Paul