Obsidian allows linking to a header or block on the same page. A common situation is having a TOC at the top of the page, linking to headers, or using links to blocks to jump between sections on the same page.
For a lot of situations it might actually be an anti-pattern to organize thoughts in long pages instead of having smaller chunks. But there are certainly use cases where one wants to repeatedly jump to certain sections on the same page, maybe going back and forth between the section and the TOC, or jump from one section to a “deeper” one on the same page, then go back an continue reading. In both cases I retain the “higher” context, either the TOC or the section from where I dive deeper and back up again.
Problem: In Obsidian Alt-Left (on Windows) navigates back to the previous page, not back to the cursor position on the same page from where the jump originated (e.g. a link in the TOC, or the link which points to a block id on the same page).
Proposed solution
With a web browser, navigating backwards takes me either to the previous page (as Obsidian does) or repositions the cursor on the same page, for jumps to anchors on the same page. It would be great if Obsidian showed the same kind of behaviour.
Current workaround (optional)
I use a plugin which remembers the cursor position, but it doesn’t help in this case. After navigating back with Alt-Left and navigating forward with Alt-Right, I am back at the intra-link target (e.g. the header I jumped to from the TOC).
I was just about to file this as a bug, not a feature request. Rationale: this is the expected behavior from the forward/back navigation pattern on every major web browser.
Aside: There are myriad valid use cases for notes which extend “past the fold”, nothing anti-pattern about it. Even users being otherwise strict regarding note atomicity often have inbox/automation/clipping workflows that capture long form inputs to the otherwise atomic system.
I’ll argue that failing to maintain cursor position is essentially a failure to correctly save/restore the user history state, which is really what forward/back navigation is doing – not simply page-level navigation.
+1. I use header and block anchors extensively, even manually naming most of my inline block anchors. Not being able to quickly jump back to where I clicked the link is borderline infuriating.
Seems like there is already a community plugin: “Navigate Cursor History”
It tracks the cursor history and provides a shortcut for jumping back and forth.
Thanks. This is almost what I was looking for. It’s good for jumping around on a singe page – already a plus – but it doesn’t work well when flipping between pages. It seems to be looking for literal cursor positions, so if you skip through pages without going into a mode where you can place a cursor, the trail is lost.
Seems like chunks of it should be merged to the native obsidian page forward/back functions. So the combination will change “views” if what you see on the screen changes, whether or not there is a cursor. And if there is a previous cursor without changing the page, then it should move the cursor to the previous position on that page.
A vote up here. It seems tons of software share the common shortcut for Alt-Left to go to the previous location, which I, personally, used a lot. Hope it can be implemented.
Was about to post a FR for this too! I’ll put it here instead.
After following link to to header/block within same note, allow to jump back to link
Currently following a link to another place in the same note is a one-way ticket. This discourages navigation within the same note via links because you know you’ll get stranded and will have to manually find your way back to your previous scrolling position in the file.
Proposed solutions:
The “Navigate back” button (“←”) should lead back to the intra-link, not previously opened file
Place a (temporary) button to go back to link at the end of the header/block, just like with footnotes!
+1 +1 for sure Would make my workflow so much easier, and be more similar to the workflow I’m used to with IDEs (clicking on a function, reading the definition, then hitting “Go to previous cursor position” to get back to where I was)
If some day this gets considered valuable by the Obsidian team and gets implemented please don’t forget to include command to use on mobile, it would help a lot with navigation.
Let’s say I have a long note which contains a footnote reference [1] near the top. As I’m reading the note, I click on the footnote reference to take me to the bottom of the page where I can see/edit the footnote. After I’m done, I’d like to quickly go back to the footnote reference by clicking the mouse “back” button to continue reading.
Current workaround (optional)
There already exists an arrow button beside the footnote to go back to the reference location, but the button is small and I’d prefer to minimize how much I need to hunt for buttons on screen with the cursor since can often lead to misclicks and is slower.
Proposed solutions
A solution could be to add the footnote reference’s line number to the navigation history used by the UI and mouse forward/back buttons. This would allow us to quickly scroll back up to where we originally clicked on that footnote reference.
A more general solution could be to track any selected line changes in the note within the navigation history, not just when clicking footnote references.
One approach would be to add any line to the history when the user clicks on it. However this may make it cumbersome for users to quickly switch between tabs/files since they’d first have to go through a bunch of lines within the same note first.
Another approach to minimize the history could be to only track lines when a “significant” action has been taken on that line (e.g. the user edits the line, the user clicks on a link, etc.).
An example of this feature can be seen in Visual Studio 2022.