[TxMt] TMTOOLS plug-in 0.9 release (for testing!)

Hans-Jörg Bibiko bibiko at eva.mpg.de
Tue Oct 9 22:31:19 UTC 2007


On 09.10.2007, at 23:21, Thomas Aylott wrote:
> On Oct 9, 2007, at 12:34 PM, Hans-Jörg Bibiko wrote:
>> I 'finished' the recoding of TMTOOLS. If someone has a bit time  
>> please give me a feedback about the functionality, bugs, wishes, etc.
>> Please note: The version 0.9 is still beta, i.e. please be careful  
>> while testing it. By myself I use it every day while working, and  
>> it helps me a lot; at least for me ;)
> Wow, This is incredible!
> I can hardly wait to start fiddling with this puppy.
> Do you have this under subversion or anything yet?
> I would love this to be a part of bundleforge.
Not yet. I want to wait a bit for the very first feedbacks (bug  
fixing) and maybe for TM 2.0 (syntax fixing).

> Do you have some commands and stuff that you've created to work  
> with your plugin?
Yes.

You saw in the demo a window showing the current scopes. It's quite  
useful for writing a grammar and for linguistic stuff.

Then the command (bound to TAB):
"$TMTOOLS" goto nextSnippetField
"$TMTOOLS" call command '{name="showAsList";}'

whereby showAsList is a normal bundle command which does from a  
selected string à la 'yes|no' an inline menu.
E.g. the XSL bundle snippets are written in such a style to give an  
hint for possible values etc.

For me it is often the case that I have to deal with 3 or 4 files at  
same time and I want to see all files at my screen. So I wrote a  
tmCommand which opens these files and resize/locate them on my screen  
automatically.

My favorite is the "$TMTOOLS" complete ... stuff (Many thanks to  
Joachim Mårtensson)

or

-call the tmCommand "Create HTML From Document / Selection"
-replace the font-size:xxpt with my font size in the HTML code by  
using a macro
-showWebPreview

and and and and ...
Maybe it would be the best that I put some of my stuff as examples in  
a TMTOOLSexamples bundle.

>
> Also, is there anything in here for handling selections?
Yes:
1) set the caret to a specific point
"$TMTOOLS" set caretTo '{line=2;index=4;}'
2) from the set caret location you can select to the end of line 3
"$TMTOOLS" set selectionTo '{line=3;column=end;}'

or use a dynamic generated macro for that à la:
"$TMTOOLS" call macro '{
                 commands = (
                     {command = "moveWordRight:"; },
                     {command = "moveWordLeftAndModifySelection:"; },
                     {command = "moveWordLeftAndModifySelection:"; },
                     {command = "moveWordLeftAndModifySelection:"; }
                 );
             }'

and read the help file additionally. Remember you can create each  
PLIST content dynamically by using Ruby, bash, Perl etc. and you can  
call a system command with "$TMTOOLS" from inside of each Ruby,  
Perl, ... script!

> Or something to do a regex search?
> 	I'd love to be able to initiate a regex search in textmate with a  
> dynamically generated search string.
> 	I could then do some fancy footwork to intelligently set your  
> selection.
>
This is quite easy.
Have a look at TMTOOLS help file - item 3.5.4 "$TMTOOLS" call macro  
PLIST second example.
Generate a plist and pipe it to $TMTOOLS" call macro - [the hyphen is  
important to read on STDIN; look at item 3.1.1 second example for the  
syntax]
The best starting point is to record a macro for a regexp search and  
have a look at this macro. Then you can use it as template for  
"$TMTOOLS" call macro PLIST.

Hans








More information about the textmate mailing list