When I try to update a long note, I need to scroll up and down to read the relative contents. And consequently, after a few times, the line where the cursor is located may be scrolled outside the screen display. And it is not easy, in this circumstance, to figure out where the cursor is and which line you are updating now, even if the cursor does not move at all and is still in that line.
Things I have tried
I’d like to find a hotkey or something, so that the line where the cursor is can be seen on the center or top or bottom of the screen.
FYI, in Emacs this feature is known as Recentering and it is bounded to the hotkey C-l (ctrl-l)
C-l
Scroll the selected window so the current line is the center-most text line; on subsequent consecutive invocations, make the current line the top line, the bottom line, and so on in cyclic order. Possibly redisplay the screen too (recenter-top-bottom).
Right, so you shouldn’t actually run it until you understand what it does.
If you wish, you can delete the whole vault with your custom macro (though it’s an extreme example).
For example, by turning on “Run on plugin load” you can add your custom editor/file context menu items, Obsidian event handlers (e.g. vault.on("create", ...)), and so on.
Typewriter Scroll plugin centers the caret if I’m understanding correctly.
There was also an open feature request for “scrolloff” behaviour like in Vim which doesn’t strictly center, but adds a configurable margin at top and bottom.
I haven’t heard of this plugin until now, and it looks awesome!
But what this plugin does seems a little bit different from recentering to me.
The plugin always keeps the cursor in the middle of the screen. On the other hand, recentering scrolls the viewport so that the current cursor is placed in the middle when the recentering command is executed. And after that, the cursor can go away from the center.
Just provide more screenshots for the people who uses the Macro for the first time.
in Step 2, creating a Macro choice means:
2.1 in the QuickAdd Settings panel, config as what is shown in the bottom of the screenshot, and press Add Choice:
Thank you!
I used that plugin before. But I think the scenario/requirement here is different.
I think what I want is something that can make the editor jump back to where I was typing the text whenever I asked.