Hi. Maybe someone can tell me whether this is interesting.
While preparing the Objective-J bundle I found an useful way to write
a snippet for inserting 'import "foo.j"' or for Objective-C '#import
"foo.h"' which looks for all header files in the project or at the
current path and down and shows up them as a inline menu list with
relative paths to the current file. The TAB trigger is e.g. impp.
A demo movie can be found here: http://www.bibiko.de/TM_importAsFileList.mov
.
The snippet looks like
import "${1:`"$TM_BUNDLE_SUPPORT/bin/import_FileMenu.sh" ".j"`}"
#import "${1:`"$TM_BUNDLE_SUPPORT/bin/import_FileMenu.sh" ".h"`}"
To use it system-widely one could save it in SUPPORT_PATH/lib. Any
comment??
--Hans
Hello List,
I am new on this list and here is my first question to TM: I've started to
learn programming with C. of course, I want to use TM as editor because of
my positive experiences with the LaTex bundle. now i've the problem with
compiling the source code. everytime pushing cmd+r, I get the error: "no
xcode project available" so I compile the c-files manually with the
terminal. that is not very comfortable;)
my question is, if there is a way that I push cmd+r, TM runs the gcc in the
background und execute the file in the terminal automatically? and if there
is a source error TM jumps to the specific line? my current version of TM
is 1.5.7 (1464).
thanks a lot for your help.
sebastian
>
> When using the LaTeX bundle, "Reformat paragraph" isn't very clever
>
about respecting things like environments that aren't separated by a
>
blank line and commands like \item and \caption that might take
>
paragraph text. Is it possible to customise this?
>
>
> I think it's more a question of someone just writing a "reformat
>
paragraph" script for LaTeX files. Then you can bind it to the same
keystroke. But I don't know of any such "latex beautifier". If we can
formalize precisely what such a script should be doing, it will
probably be not too hard to write one.
The standard LaTeX bundles still(!) ships with an old LaTeX Tidy I wrote,
under "Tidy". It is simple-minded and works on the whole document. You
should try it out and see if it gets close to what you want. You may be able
to effectively customize it (it's a perl script LaTeXTidy.pl in
Latex.tmbundle/Support/bin). Here are the notes from the script comments:
# General Idea
# ------------
# Eat all single newlines. Add newlines after all "\\"
# Newlines before each \begin and \end. After each \end{}
# Each environment \begin adds a level of tab.
# Newlines before each \item.
# \n before each \[ and after each \]
best wishes, Eric
--
Eric Hsu, Associate Professor of Mathematics
San Francisco State University
http://math.sfsu.edu/hsu
erichsu(a)math.sfsu.edu
Hi,
up to now it is not possible to use the JavaScript functions alert()
and confirm() within TM's HTML output window.
But there is a solution (unfortunately this does not work for the HTML
preview :( ).
The only thing I do is to write a kind of wrapper for these functions
by using TextMate.system('"$DIALOG" -e ...').
<script type="text/javascript" charset="utf-8">
try {
if (TextMate.system("", function (task) { })) {
var __TM_confirm_Status;
alert = function(s){TextMate.system('"$DIALOG" -e -p
\'{messageTitle="JavaScript";informativeText="'+s+'";}\'',null);};
confirm = function(s){TextMate.system('"$DIALOG" -e -p
\'{messageTitle="JavaScript";informativeText="'+s
+'";buttonTitles=("OK","Cancel");}\'',null).onreadoutput=function(s)
{if(s==1)
{__TM_confirm_Status
=false}else{__TM_confirm_Status=true}};return(__TM_confirm_Status)};
}
} catch(e) {}
</script>
The try block will be only executed if the code will be showed up in
TM HTML output window.
If you put these lines into your HTML code the page will work within a
normal browser as well as in TM's HTML output window.
Attached is a demo command. Simply press the buttons ;)
BTW With this approach I can prompt JavaScript errors by using simply
"alert(err)" inside of TM ;)
--Hans
I inadvertently pasted several megabytes of characters into the find
field of the search and replace dialogue box. The performance of TM
dropped significantly whenever the dialogue was displayed as a result.
I tried using the CLI tool defaults to remove the find history from
the preference file and even reverted to an earlier version of the
preference file (courtesy of Time Machine) to reduce the preference
file size from 4.5M to 25K. Unfortunately starting TM again somehow
restored the preference file so I was still left with the problem.
It turned out the fix was simple - just select a few characters and
Command E to make them the new find string. Repeat with a different
set of characters a dozen or so times. This pushes the offending
search string down the history list until it is discarded.
Dave.
Hi,
I have an HTML page running in TM's HTML output window with embedded
JavaScript and my JavaScript is not correct, I can invoke 'Inspect
Element' to see the error. Fine.
But is there a way to access the error message from outside, I mean
by a script?
If not, would it be possible to redirect the JavaScript error
messages to a log file?
Many thanks in advance,
--Hans
Hi,
would it be also useful for other users to have the chance to set the
appearance of the HTML output window as:
- normal window (like the current one)
- HUD window
- frameless window (like HTML tooltip)
- maybe some others
Technically it should be "quite" simple to provide these options.
Or am I wrong?
Regards,
--Hans
Hi,
if I have an HTML page (TM's HTML output window) with embedded
JavaScript and my JavaScript is not correct I can press the right
mouse button and invoke 'Inspect Element' to look at the JavaScript
error(s). Fine.
But is there a way to access the(se) error(s) from outside, I mean by
a script?
If not, would it be possible to redirect the(se) error(s) to a log file?
Many thanks in advance,
--Hans
Writing a ruby command for TextMate to reformat author names
in a list of papers I run into the obvious but sad fact that
/[A-z]/ =~ "ü"
does not match anything. Is there a simple workaround?
I mean, simpler than a very long and unelegant list of Unicode
ranges such as the one here
http://forums.mozillazine.org/viewtopic.php?f=25&t=834075
Thanks,
Piero
Just wanted to let you guys know that I updated my CSS bundle with
even more tab triggers! ;) Some other additions and fixes too... For
more info and screencast, go to my site:
http://minimaldesign.net/articles/read/textmate-css-bundle-11
btw, I don't mind including my stuff in the official bundle and
contributing to official CSS/HTML bundles in general if that's
something you'd be interested in. Just let me know.