From 82c1d4b5ccc6e87c83ec31c88451026e6a04a7c2 Mon Sep 17 00:00:00 2001 From: Mountain Man <43313373+MountainMan1312@users.noreply.github.com> Date: Thu, 20 Apr 2023 13:52:44 -0400 Subject: Enhance scrolling behavior Make scrolling smooth and easy to follow, as opposed to the jumpy default behavior. Add a scroll margin and make point move to the top/bottom of the screen if attempting to scroll past the beginning/end of the buffer. --- init.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/init.el b/init.el index faf8233..a578665 100644 --- a/init.el +++ b/init.el @@ -90,6 +90,34 @@ (global-visual-line-mode) +;; --------------------------------- +;; Scrolling +;; --------- +;; This makes the scrolling behavior +;; smoother and easier to follow. +;; --------------------------------- + +;; Small scroll margin makes it +;; easier to see when to stop when +;; scrolling fast. +(setq scroll-margin 2) + +;; Make mouse scroll smoother +(setq mouse-wheel-scroll-amount '(2)) + mouse-wheel-progressive-speed nil + mouse-wheel-follow-mouse t) + +;; Prevent jumpy scrolling +(setq scroll-conservatively 10 + auto-window-vscroll nil + scroll-preserve-screen-position t) + +;; Move point to beginning/end of +;; buffer if attempting to scroll +;; when already at the beginning/end +;; of buffer +(setq scroll-error-top-bottom t) + ;; --------------------------------------------------------------------- -- cgit v1.2.3