Good day commander !
How to restore cursor position on open file ?
Is there any plugin ?
Cant find them
thx
Good day commander !
How to restore cursor position on open file ?
Is there any plugin ?
Cant find them
thx
I believe by default ST should restore any cursors, (multi-)selections you have made in any open files. You don’t require a plugin for that.
Cursors are rested when ST is restarted or a workspace is re-opened, but for files that have been closed the selection, edit history, etc. is discarded.
VS Code indeed seems to restore selections for closed files. You could file a feature request, though https://github.com/sublimehq/sublime_text/issues
For all intents & purposes, they refer to the same thing. A cursor is just an empty selection of length 0.
Anyways, your best bet is to open a feature request as stated above, because as also stated by bscaaf, ST doesn’t retain those information when the document closes.
This is actually the very first plugin I wrote because it’s a highly desirable feature which IMO should be provided by default:
https://gmpy.dev/blog/2022/sublime-text-remember-cursor-position-plugin
Since then (2022) I extended it a bit (e.g. added support to restore bookmarks and viewport pos), but I didn’t open source it yet. There are circumstances such as LSP goto command where you don’t want to restore position. Anyway, for basic needs it does it jobs (plus you can modify it).
Note: there’s a plugin called BufferScroll (https://github.com/titoBouzout/BufferScroll) which does this, but to my experience is broken.