"Go to last edit" keyboard shortcut

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

"Go to last edit" keyboard shortcut

by Alessandro Vernet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there an "Go to last edit" keyboard shortcut, or a way to create one in TextMate?

Essentially, the idea is that when editing a file, I often move around in the file to check other things and then want to come back to the place I was editing to continue what I was doing. Now I have to remember to add a bookmark, before navigating around, then find that bookmark, and remove it, which is a bit cumbersome.

Alex
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet

Re: "Go to last edit" keyboard shortcut

by Steve King-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 16 Oct 2009, at 15:01, Alessandro Vernet wrote:

Is there an "Go to last edit" keyboard shortcut, or a way to create one in
TextMate?

A side effect of Undo is that the cursor jumps back to the position of the edit. So a cheesy way to get the functionality you want is to hit Undo then Redo. You could bind that to a macro command if you want it as a single keystroke.

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461






_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

smime.p7s (3K) Download Attachment

Re: "Go to last edit" keyboard shortcut

by Alessandro Vernet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Steve,

Steve King-8 wrote:
A side effect of Undo is that the cursor jumps back to the position of  
the edit. So a cheesy way to get the functionality you want is to hit  
Undo then Redo. You could bind that to a macro command if you want it  
as a single keystroke.
It is funny that you should suggest that, because I tried doing *exactly* that this morning. Unfortunately while doing undo/redo "by hand" works fine, creating a macro that runs those commands doesn't do anything for me.

Here is the macro I recorded: Go+to+last+edit.tmMacro
Can see anything wrong with it?

Alex

Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet

Re: "Go to last edit" keyboard shortcut

by Alessandro Vernet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alessandro Vernet wrote:
It is funny that you should suggest that, because I tried doing *exactly* that this morning. Unfortunately while doing undo/redo "by hand" works fine, creating a macro that runs those commands doesn't do anything for me.

Here is the macro I recorded: Go+to+last+edit.tmMacro
Can see anything wrong with it?
Anybody has an idea about this one?

Alex
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet

Re: "Go to last edit" keyboard shortcut

by Steve King-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 25 Oct 2009, at 13:51, Alessandro Vernet wrote:

Alessandro Vernet wrote:

It is funny that you should suggest that, because I tried doing *exactly*
that this morning. Unfortunately while doing undo/redo "by hand" works
fine, creating a macro that runs those commands doesn't do anything for
me.

Here is the macro I recorded:
http://www.nabble.com/file/p25932786/Go%2Bto%2Blast%2Bedit.tmMacro
Go+to+last+edit.tmMacro
Can see anything wrong with it?


Anybody has an idea about this one?

You're right, it looks like undo and redo can't be recorded in a macro. I tried editing the macro file by hand to add them, but no luck. Sorry, I don't have any other bright ideas.

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461






_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

smime.p7s (3K) Download Attachment

Re: "Go to last edit" keyboard shortcut

by Hans-Jörg Bibiko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 26, 2009, at 5:41 PM, Steve King wrote:

> On 25 Oct 2009, at 13:51, Alessandro Vernet wrote:
>
>> Alessandro Vernet wrote:
>>>
>>> It is funny that you should suggest that, because I tried doing  
>>> *exactly*
>>> that this morning. Unfortunately while doing undo/redo "by hand"  
>>> works
>>> fine, creating a macro that runs those commands doesn't do  
>>> anything for
>>> me.
>>>
>>> Here is the macro I recorded:
>>> http://www.nabble.com/file/p25932786/Go%2Bto%2Blast%2Bedit.tmMacro
>>> Go+to+last+edit.tmMacro
>>> Can see anything wrong with it?
>>>
>>
>> Anybody has an idea about this one?
>
> You're right, it looks like undo and redo can't be recorded in a  
> macro. I tried editing the macro file by hand to add them, but no  
> luck. Sorry, I don't have any other bright ideas.

Hi,

maybe try to record that macro :

ARROW_RIGHT →
ARROW_LEFT ←

or create a new tmcommand in the Bundle Editor:

Input: None
Output: Discard
Command:
open "txmt://open?line=$TM_LINE_NUMBER&column=$TM_COLUMN_NUMBER"

and bind it to any keystroke.

Cheers,

--Hans



_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by drukepple :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 25 Oct 2009, at 13:51, Alessandro Vernet wrote: 
You're right, it looks like undo and redo can't be recorded in a macro. I tried editing the macro file by hand to add them, but no   luck.   Sorry, I don't have any other bright ideas.
 
 
Well, I was trying to utilize AppleScript.  I got a plain old script working:
 
tell application "System Events"
 tell process "TextMate"
  set frontmost to true
  keystroke "z" using {command down}
  keystroke "z" using {command down, shift down}
 end tell
end tell
 
Assuming you have "Enable Access for Assistive Devices" turned on in the Universal Access pref pane.
 
I got it working from the Terminal:
 
osascript -e 'tell application "System Events" to tell process "TextMate" to set frontmost to true'; osascript -e 'tell application "System Events" to tell process "TextMate" to keystroke "z" using {command down}'; osascript -e 'tell application "System Events" to tell process "TextMate" to keystroke "z" using {command down, shift down}'
(that's three commands all on one line...)
 
But putting that command into a TM Command doesn't seem to work.  I'm far from a scripting expert, Apple- or Bash, so maybe it could work with more love.  I've spent about as much time as I'm able to spend on such things, so hopefully someone else with more skills can take the idea? 
 
Dru


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Steve King-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 26 Oct 2009, at 13:32, Dru Kepple wrote:

Well, I was trying to utilize AppleScript.  I got a plain old script working:
[...] 
But putting that command into a TM Command doesn't seem to work.  I'm far from a scripting expert, Apple- or Bash, so maybe it could work with more love.  I've spent about as much time as I'm able to spend on such things, so hopefully someone else with more skills can take the idea? 

I took that idea and got it working with Butler. Butler is a hot-key manager / app launcher / kitchen sink, and is available from http://www.manytricks.com/butler/.  Anyway, with Butler it's trivial. Create a new Smart Item -> Keystrokes containing ⌘Z and ⇧⌘Z, assign it a hot key, and set "Only valid in..." to TextMate. Piece of cake.

Still no idea how to do it using only TextMate and what's natively installed.

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461






_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

smime.p7s (3K) Download Attachment

Re: "Go to last edit" keyboard shortcut

by Alessandro Vernet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Steve,

Steve King-8 wrote:
I took that idea and got it working with Butler. Butler is a hot-key  
manager / app launcher / kitchen sink, and is available from http://www.manytricks.com/butler/ 
.  Anyway, with Butler it's trivial. Create a new Smart Item ->  
Keystrokes containing ⌘Z and ⇧⌘Z, assign it a hot key, and set  
"Only valid in..." to TextMate. Piece of cake.
Awesome! And as a bonus, I get to discover Butler. This is quite a kitchen sink indeed, but it looks like a very powerful one.

Steve King-8 wrote:
Still no idea how to do it using only TextMate and what's natively  
installed.
Maybe for the next version of TextMate!

Alex
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet

Re: "Go to last edit" keyboard shortcut

by Allan Odgaard-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 26 Oct 2009, at 22:25, Alessandro Vernet wrote:

> Steve King-8 wrote:
>>
>> Still no idea how to do it using only TextMate and what's natively
>> installed.
>
> Maybe for the next version of TextMate!

I think the undo/redo trick is a quite natural solution to the problem  
(but no, you can’t record undo/redo in macros for technical reasons).

Another solution is bookmarks (which have to be set explicitly with  
⌘F2).

I am aware of the requests for an “last edit stack”, I am still  
undecided about whether or not to do one, regardless though, I expect  
2.0 to be just the bare minimum to get it out the door, the extra  
features will have to come later (2.1, etc.)… people have been  
waiting for too long, I better not make them wait any longer than  
absolutely necessary ;)



_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Hans-Jörg Bibiko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I only can tell you again that my tiny macro (moveRight: moveLeft:  
moveRight: moveLeft:) works. (I do it twice only for refreshing the  
view port)

See attachment. Macro bound to ^⌥⌘→

Cheers,

--Hans




_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

ScrollToCursor.tmMacro (1014 bytes) Download Attachment

Re: "Go to last edit" keyboard shortcut

by Steve King-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Hans-Jörg Bibiko
> I only can tell you again that my tiny macro (moveRight: moveLeft:  
> moveRight: moveLeft:) works. (I do it twice only for refreshing the  
> view port)

I don't understand why that would work.  If you've made an edit, then moved
the cursor to another part of the document, how does this right/left macro
bring you back to the point of the last edit?

(My hard drive died and I'm using a loaner computer without TextMate, or I'd
try it myself.)


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Steve King-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Allan Odgaard
> I am aware of the requests for an "last edit stack", I am still  
> undecided about whether or not to do one, [...]

A feature that I really loved in CodeWright (for Windows, now sadly
discontinued) was that cursor movements would be placed in the undo stack
along with edits. Move the cursor, and it was a simple undo operation to
return to where you were. It also had a feature to compress multiple
movements into a single undo item, so if you use the arrows to go up 10 lines
it's a single undo to return to your last edit point.

CodeWright would also combine a continuous series of edits into a single undo
item, so you didn't have to hold the undo key for a long time to get rid of
your entire last change character by character.


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Gerd Knops-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 28, 2009, at 8:28 AM, King, Steven wrote:

> From: Allan Odgaard
>> I am aware of the requests for an "last edit stack", I am still
>> undecided about whether or not to do one, [...]
>
> A feature that I really loved in CodeWright (for Windows, now sadly
> discontinued) was that cursor movements would be placed in the undo  
> stack
> along with edits.

Way back then there was a fantastic editor for Atari ST/TT that had a  
similar feature. It was EXTREMELY useful, which is why I wrote a  
bundle emulating it for jEdit (my editor of choice before TM). I am  
disappointed that TM2 will not have it.

Gerd


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Hans-Jörg Bibiko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 16, 2009, at 9:01 PM, Alessandro Vernet wrote:
> Essentially, the idea is that when editing a file, I often move  
> around in
> the file to check other things and then want to come back to the  
> place I was
> editing to continue what I was doing. Now I have to remember to add a
> bookmark, before navigating around, then find that bookmark, and  
> remove it,
> which is a bit cumbersome.

I understood by "…move around…" scrolling to other places in the  
file WITHOUT moving the caret. By pressing ⇢ and ⇠ one scrolls back  
to the caret.

If you "move around" by using the caret then you can make usage of  
AppleScript (see also attachment):

Create a tmcommand:

Input: none
Output: discard
Command:
cat <<-AS | iconv -f UTF-8 -t MACROMAN | osascript -- 2>&1 1>/dev/null
tell application "TextMate" to activate
tell application "System Events" to tell process "TextMate" to tell  
menu bar 1 to tell menu bar item "Edit" to tell menu "Edit" to click  
menu item "Undo"
tell application "System Events" to tell process "TextMate" to tell  
menu bar 1 to tell menu bar item "Edit" to tell menu "Edit" to click  
menu item "Redo"
AS


The iconv stuff is only needed to be compatible with Tiger.

One could speed up it by pre-compiling the AppleScript and run it.


Cheers,

--Hans




_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

GoToLastEdit.tmCommand (1K) Download Attachment

Re: "Go to last edit" keyboard shortcut

by Hans-Jörg Bibiko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or a bit faster is this tmCommand for MacOSX >= 10.5:

Input: none
Output: discard
Command:
cat <<-AS | osascript --
tell application "System Events"
  tell process "TextMate"
   tell menu bar 1
    tell menu bar item "Edit"
     tell menu "Edit"
      click menu item "Undo"
      click menu item "Redo"
     end tell
    end tell
   end tell
  end tell
end tell
AS


It won't be faster significantly if one pre-compliles it.


Cheers,
--Hans

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Ed Wong-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I understood by "…move around…" scrolling to other places in the  
> file WITHOUT moving the caret. By pressing ⇢ and ⇠ one scrolls  
> back to the caret.

Must simpler to use Cmd-J to do the same thing.

Ed Wong


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by drukepple :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: textmate-bounces+dru=summitprojects.com@... [mailto:textmate-bounces+dru=summitprojects.com@...] On Behalf Of Hans-Jörg Bibiko
Sent: Wednesday, October 28, 2009 7:43 AM


Or a bit faster is this tmCommand for MacOSX >= 10.5:

Input: none
Output: discard
Command:
cat <<-AS | osascript --
tell application "System Events"
  tell process "TextMate"
   tell menu bar 1
    tell menu bar item "Edit"
     tell menu "Edit"
      click menu item "Undo"
      click menu item "Redo"
     end tell
    end tell
   end tell
  end tell
end tell
AS


It won't be faster significantly if one pre-compliles it.


_______________________________________________




_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by drukepple :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: textmate-bounces+dru=summitprojects.com@... [mailto:textmate-bounces+dru=summitprojects.com@...] On Behalf Of Hans-Jörg Bibiko

Command:
cat <<-AS | osascript --
tell application "System Events"
  tell process "TextMate"
   tell menu bar 1
    tell menu bar item "Edit"
     tell menu "Edit"
      click menu item "Undo"
      click menu item "Redo"
     end tell
    end tell
   end tell
  end tell
end tell
AS

_______________________________________________



For some reason this doesn't work for me.  This is the same idea I was trying to get working, only I was using keystroke simulation.  Is anyone else able to get this to work?  I'm on 10.5.

(Sorry for me previously empty submission...I'm on a Windows box for my email.  The keyboard shortcuts surprise me sometimes.  Sucks.)

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: "Go to last edit" keyboard shortcut

by Hans-Jörg Bibiko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 28, 2009, at 4:37 PM, Dru Kepple wrote:
> For some reason this doesn't work for me.  This is the same idea I  
> was trying to get working, only I was using keystroke simulation.  
> Is anyone else able to get this to work?  I'm on 10.5.

This should work if you did enable in System Preferences > Universal  
Access > "Enable access for assistive devices"


But you can try if the attached tmPlugin works for better and faster ;)

How to install:
- quit TextMate
- copy the plugin to ~/Library/Application Support/TextMate/PlugIns
- launch TextMate
- have a look at the the Main Menu > Navigation (last item)


I compiled it as 32bit Universal binary for MacOSX >= 10.5

Cheers,

--Hans




_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

TMGoToLastEdit.tmplugin.zip (8K) Download Attachment
< Prev | 1 - 2 | Next >