Restore last document position/scroll position/cursor position

Another look at it:

Obsidian shouldn’t close the note when you navigate to another…
Such behaviour should be associated with clicking the X

This closing results in the cursor position being reset, it’s counter-intuitive.

for this you need to do something like tabs like in notepad ++
in any case, I hope that saving the position will be the same as in notepad ++

I think the topic of tabs is irrelevant to this issue.

Many people find tabs redundant as long as you have another way to navigate to recent files.

Tabs suggest there is the following use case:

  • As a user I want to always know which files are opened.

However, most common use case for tabs is this:

  • As a user I want to quickly navigate to a file/window that I recently viewed/edited.

We already have this functionality in cmd+o so I personally see no point.

However, keeping the file open == holding info about the cursor, hence I mentioned it.

apparently I did not quite understand correctly, sorry

1 Like

+1 for remembering cursor!

Funny enough I had the same frustration yesterday and put together a simple “ambient” plugin that keeps track of my cursor in each note and places it back where I left off. It works even after closing the note or quitting Obsidian!

I built this just for myself but if you want to try it out, here’s the repo:

Edit: I should add, this is so new that I haven’t stress-tested this yet. So this is really not production-ready!

4 Likes

@akaalias
Appreciate you build this plugin.

But why didn’t work on my side ? What was I missed ?
J0yE4Lodgf

Steps:

  1. put a cursor in one line.
  2. close page by mouse.
  3. re-open it. check the position .

Thank you .

1 Like

Greetings @Steve_yang! Thank you for asking, that’s a great question. I love that you documented the steps because that explains why it’s not working:

For now the plugin only records your position when you use your keyboard but not your mouse. (That’s mostly because I personally don’t use a mouse.)

Please check if your cursor-position is retained when using your keyboard to either write or navigate.

Thanks!

PS: I have this on my radar though and will look into converting a mouse-click into a cursor position as an upcoming feature.

Update:

I went ahead and added mouse-click support in release 0.0.4

Reporting issues

Moving forward, please file your issues on Github

3 Likes

strange that when using the back and forward buttons, the position of the pages is remembered

Thanks a lot for making this plugin. I really hope this becomes a standard feature. At least the option to have the cursor at the end position of the document would be very helpful. I guess it’s safe to assume that the most common scenario when opening a file is to continue writing at the end but not at the start of the text.

Awesome plugin, @akaalias, thank you.

This should be core functionality though, I hope it’ll be implemented soon…

3 Likes

Hi. Check this plugin: Remember cursor position

Completely agree. I often work with multiple documents and the fact that the cursor is lost when doing Ctrl+O is super annoying. My flow is totally broken. Alt+Back Arrow is not as bad since scroll position is similar but there is no visible cursor.

1 Like

I really need this, too.

I’m writing a Kindle Vella serial (directly in Obsidian) and find myself constantly switching between character notes, story notes, and different episodes. It’s especially painful to quickly switch from an episode to a different note and then back again and have to find my spot all over.

3 Likes

This is highly needed :slight_smile:

1 Like

+1 to this feature.

I agree, losing the Undo/Redo history every time I switch between the notes is very frustrating.

Using the workspaces core plugin, I can restore the files and splits I had open. But Obsidian doesn’t seem to save the position I was scrolled at. I would like to suggest implementing this.

At present workspaces aren’t quite that useful because I end up forgetting why I had a specific large file open alongside others. When I do know why, I have to scroll my panes all over again. Being at the section I left off would be great.

3 Likes

Editing between different files is so common a behavior . I think this should be a built-in feature. It would be so wonderful if this can be implemented.

Scroll position is lost when changing pages.
This is very annoying when using obsidian a lot.
Shouldn’t be that hard to save a history (last line, folding states) per page.

Steps to reproduce

Enable headline/indent folding
Fold something on page 1, scroll down
Change to page2,
Change back to page1

Expected result

Cursor (and scroll bar) should be as it was on page 1

Actual result

It goes back to first line, and reparses page (sometimes code folding state is also lost)

Environment

  • Operating system: win10 x64

  • Debug info:
    ||Obsidian version: v0.13.19|
    |—|—|
    ||Installer version: v0.13.19|
    ||Login status: not logged in|
    ||Insider build toggle: off|
    ||Live preview: on|
    ||Legacy editor: off|
    ||Base theme: dark|
    ||Community theme: custom|
    ||Snippets enabled: 0|
    ||Safe mode: on|

This plugin can be handy

2 Likes