@@ -3,6 +3,31 @@
;;; Navigation related configuration
;;; Code:
+(use-package emacs
+ :config
+ (setq-default scroll-preserve-screen-position t)
+ (setq-default scroll-conservatively 1) ; affects `scroll-step'
+ (setq-default scroll-margin 0)
+
+ (define-minor-mode vde/scroll-centre-cursor-mode
+ "Toggle centred cursor scrolling behaviour."
+ :init-value nil
+ :lighter " S="
+ :global nil
+ (if vde/scroll-centre-cursor-mode
+ (setq-local scroll-margin (* (frame-height) 2)
+ scroll-conservatively 0
+ maximum-scroll-margin 0.5)
+ (dolist (local '(scroll-preserve-screen-position
+ scroll-conservatively
+ maximum-scroll-margin
+ scroll-margin))
+ (kill-local-variable `,local))))
+
+ ;; C-c l is used for `org-store-link'. The mnemonic for this is to
+ ;; focus the Line and also works as a variant of C-l.
+ :bind ("C-c L" . vde/scroll-centre-cursor-mode))
+
(use-package avy
:disabled
:bind (("C-c j" . avy-goto-word-1)