I’m been starting to use go-to-definition commands more and more in TextMate. One thing that would be really nice is if there was a way to navigate back to the location where I invoked go-to-definition. I quite often look up the source code of a symbol that I’m using with the help of go-to-definition and then need to get back to where I was coding. If go-to-definition opens a new file it’s pretty easy to get back to the previous location by just closing the newly opened file. But if the definition is in the same file it’s not that easy to get back. One idea would be set a mark when go-to-definition is invoked, then use Jump To Next/Previous Mark. The problem with that is that there might be different marks, like marks set by compiling the code. These marks will now interfere with go-to-definition marks. It’s also quite difficult to build up a stack, allowing to navigate backwards and forwards with these marks. Since navigating between marks will, I think, in the order they’re located in the document, not the order they were created or any other user defined order.
Ideally this would be a built in feature in TextMate, making it possible to navigate backwards and forwards regardless if the “mate” command, the Jump to Line or any other feature was used to navigate the code.
This reminds me of my suggestion from September of 2014, which I'll just repeat:
As you know, I use TextMate to write books. Big books with big chapters. So it often happens that I edit a chapter, then jump to an earlier / later bit of that same chapter to make some change entailed by what I was just writing. Now I want to "go back" to where I was before.
That's the suggestion. TextMate should _automatically_ maintain "bookmarks" for the location of the two most recent edit locations (places where I actually typed or deleted text). Thus, I could use the bookmarks feature to jump back to where I was before.
The "bookmarks" idea was really just a stopgap. What I really want is what you want: there should be an easy way to "go back". m.
On Feb 1, 2018, at 1:58 PM, Jacob Carlborg doob@me.com wrote:
I’m been starting to use go-to-definition commands more and more in TextMate. One thing that would be really nice is if there was a way to navigate back to the location where I invoked go-to-definition. I quite often look up the source code of a symbol that I’m using with the help of go-to-definition and then need to get back to where I was coding. If go-to-definition opens a new file it’s pretty easy to get back to the previous location by just closing the newly opened file. But if the definition is in the same file it’s not that easy to get back. One idea would be set a mark when go-to-definition is invoked, then use Jump To Next/Previous Mark. The problem with that is that there might be different marks, like marks set by compiling the code. These marks will now interfere with go-to-definition marks. It’s also quite difficult to build up a stack, allowing to navigate backwards and forwards with these marks. Since navigating between marks will, I think, in the order they’re located in the document, not the order they were created or any other user defined order.
Ideally this would be a built in feature in TextMate, making it possible to navigate backwards and forwards regardless if the “mate” command, the Jump to Line or any other feature was used to navigate the code.
-- /Jacob Carlborg
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
-- matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 11! http://shop.oreilly.com/product/0636920107408.do iOS 11 Fundamentals! http://shop.oreilly.com/product/0636920107415.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
I use for "jumping back" a custom Key Binding.
Create a Key Binding file:
~/Library/KeyBindings/DefaultKeyBinding.dict
And add the following code:
{ // bookmark "^1" = (setMark:); // jump to bookmark "^2" = (swapWithMark:,centerSelectionInVisibleArea:); }
Press CTRL-1 for setting a bookmark; Go to an other location in the same file, and do your thing (edit...) Press CTRL-2 for going back.
NOTE: works only in the same file, and you you have to press an additional key-combination before going somewhere else..... for me it works.... (also outside TM ).
== feek
-- Sent from: http://textmate.1073791.n5.nabble.com/textmate-users-f3.html
On 2 Feb 2018, at 06:41, feek feekdiv@gmail.com wrote:
I use for "jumping back" a custom Key Binding.
Create a Key Binding file:
~/Library/KeyBindings/DefaultKeyBinding.dict
And add the following code:
{ // bookmark "^1" = (setMark:); // jump to bookmark "^2" = (swapWithMark:,centerSelectionInVisibleArea:); }
Press CTRL-1 for setting a bookmark; Go to an other location in the same file, and do your thing (edit...) Press CTRL-2 for going back.
NOTE: works only in the same file, and you you have to press an additional key-combination before going somewhere else..... for me it works.... (also outside TM ).
Hmm, that might be useful. I wonder if that works to trigger from within TextMate.
On 2 Feb 2018, at 0:41, feek wrote:
NOTE: works only in the same file, and you you have to press an additional key-combination before going somewhere else..... for me it works.... (also outside TM ).
I’m assuming the [URL scheme][1] to refer to any position in any file still works. If so, maybe there’s a way to remember the URL for a position, then open that URL later when you want to go back.
[1]: http://blog.macromates.com/2007/the-textmate-url-scheme/
On 5 Feb 2018, at 14:57, Rob McBroom mailinglist0@skurfer.com wrote: I’m assuming the URL scheme http://blog.macromates.com/2007/the-textmate-url-scheme/ to refer to any position in any file still works. If so, maybe there’s a way to remember the URL for a position, then open that URL later when you want to go back.
Yeah, that works. But there’s no good place to store the data. Since TextMate commands doesn’t save any state, the only thing I can think of is storing it in a file somewhere.
https://github.com/textmate/ctags.tmbundle
save the history position in a text file.
On Tue, Feb 6, 2018 at 1:42 AM, Jacob Carlborg doob@me.com wrote:
On 5 Feb 2018, at 14:57, Rob McBroom mailinglist0@skurfer.com wrote:
I’m assuming the URL scheme http://blog.macromates.com/2007/the-textmate-url-scheme/ to refer to any position in any file still works. If so, maybe there’s a way to remember the URL for a position, then open that URL later when you want to go back.
Yeah, that works. But there’s no good place to store the data. Since TextMate commands doesn’t save any state, the only thing I can think of is storing it in a file somewhere.
-- /Jacob Carlborg
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 22 Feb 2018, at 12:20, Yuan Jiang sleetdrop@gmail.com wrote:
https://github.com/textmate/ctags.tmbundle https://github.com/textmate/ctags.tmbundle
save the history position in a text file.
I had hoped to avoid that.