|
|
|
|
|
by dreamcompiler
1680 days ago
|
|
Related: My biggest complaint with Emacs is that when you scroll, the cursor moves to keep itself visible on-screen at all times. Modern text editors don't behave this way--it's easy to scroll to a different location to look at something without losing your insertion point. Has anybody written a patch for Emacs to implement this behavior? |
|
The "Emacs Way" here is to use a command that takes you back to where you were before. If you used tags navigation to get to what you wanted to look at, you could use `pop-tag-mark`, which is on M-, (other modes for getting around, like xref and LSP use the same binding). Or failing that, if you know you're staying in the same buffer, you can `set-mark-command`, scroll to where you want to look, and `exchange-point-and-mark` (and then deactivate the mark with C-g if you were in transient-mark-mode, which most people are these days).
There's also a package `dogears' (https://github.com/alphapapa/dogears.el) for saving your place to go back to automatically even if you're just scrolling.
I recognize that all these solutions are not intuitive to someone who expects the cursor position to stay in the same place even if it scrolls offscreen.