[TxMt] Re: Smart Home Key

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sun Dec 7 16:52:47 UTC 2008


On 07.12.2008, at 13:30, Simon Strandgaard wrote:
> On Sat, Dec 6, 2008 at 11:19 AM, Hans-Jörg Bibiko  
> <bibiko at eva.mpg.de> wrote:
>> 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
>>
>
> 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.

First it is not a snippet in TM terms. It must be a command.
Then, what's odd?

The command checks if your cursor is at the beginning of a line:  
TM_COULUMN_NUMBER==1?
If so it moves the cursor to the beginning of the doc. If not it  
moves the cursor to first column of the current line.

> if its possible to go to an X,Y position
> without modifying the document..
This is done by using 'open txmt://open?line=X&column=Y'. This  
command tells TM to activate the front most doc and set the cursor to  
X,Y without modifying the doc.

Normally I do not use the HOME key. I usually navigate by using APPLE 
+ARROW_LEFT/UP


--Hans

Attached my command.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HOME.tmCommand
Type: application/octet-stream
Size: 758 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20081207/acb7303d/attachment.tmCommand>


More information about the textmate mailing list