[TxMt] Re: Smart Home Key

Simon Strandgaard neoneye at gmail.com
Sun Dec 7 12:30:40 UTC 2008


On Sat, Dec 6, 2008 at 11:19 AM, Hans-Jörg Bibiko <bibiko at eva.mpg.de> wrote:
>
> On 06.12.2008, at 10:44, Oliver Taylor wrote:
>
>>> On Fri Dec 5 19:54:25 Simon Strandgaard wrote:
>>>
>>>> Is there a way to bind the Home key in a way so that it behaves
>>>> similar to UltraEdit?
>>>
>
> For HOME one could do this:
>
> a tmcommand bound to HOME, no input, output to show tool tip, command:
>
> if [ $TM_COLUMN_NUMBER -eq 1 ]; then
>        open "txmt://open?line=1" &
> else
>        open "txmt://open?line=$TM_LINE_NUMBER&column=1" &
> fi
>
>
> Up to now I don't see chance to preserve the selection. Maybe via
> macros. With END the same way.
[snip]

This looks promising. I have tried it out, but it behaves a bit odd.
When I first tried experimenting with it your snippet jumps to the
start of the document. Then I began writing this reply and wanted
to double check.. and I inserted your snippet again, but now it
does nothing.

line1: if [ $TM_COLUMN_NUMBER -eq 1 ]; then
line2:        open "txmt://open?line=1" &
line3: else
line4:        open "txmt://open?line=$TM_LINE_NUMBER&column=1" &
line5: fi

I wanted to write something about line2 and line4 when I evaluated
them on their own. However since nothing works now, im not sure
what I wanted to write.

line4 looks in particular useful, if its possible to go to an X,Y position
without modifying the document.. thats could be a way to do it.
if just I could get it to work.


-- 
Simon Strandgaard
my graphics program for mac - http://toolboxapp.com/


More information about the textmate mailing list