13

M-v following C-v doesn't move the cursor back to the original position. Why is that? Can we make it happen?

itsjeyd
  • 14,586
  • 3
  • 58
  • 87
Tim
  • 4,987
  • 7
  • 31
  • 60

1 Answers1

13

You can try setting scroll-preserve-screen-position to always:

(setq scroll-preserve-screen-position 'always)

From the documentation (C-h v scroll-preserve-screen-position):

Controls if scroll commands move point to keep its screen position unchanged. A value of nil means point does not keep its screen position except at the scroll margin or window boundary respectively. A value of t means point keeps its screen position if the scroll command moved it vertically out of the window, e.g. when scrolling by full screens. Any other value means point always keeps its screen position. Scroll commands should have the scroll-command property on their symbols to be controlled by this variable.

itsjeyd
  • 14,586
  • 3
  • 58
  • 87
Manuel Uberti
  • 3,150
  • 18
  • 36