Reduce cursor lag and enhance smooth scrolling
This commit is contained in:
35
init.el
35
init.el
@@ -242,23 +242,26 @@
|
|||||||
;; window.
|
;; window.
|
||||||
(setq scroll-preserve-screen-position t)
|
(setq scroll-preserve-screen-position t)
|
||||||
|
|
||||||
|
;; Setting `scroll-conservatively' to a high number like 10000 makes Emacs only
|
||||||
|
;; scroll a little bit to bring your cursor back into view, minimizing
|
||||||
|
;; unnecessary page movements.
|
||||||
|
(setq scroll-conservatively 10000)
|
||||||
|
|
||||||
|
;; Enables smooth scrolling by making Emacs scroll the window by 1 line whenever
|
||||||
|
;; the cursor moves off the visible screen.
|
||||||
|
(setq scroll-step 1)
|
||||||
|
|
||||||
|
;; Reduce cursor lag by :
|
||||||
|
;; 1. Prevent automatic adjustments to `window-vscroll' for long lines.
|
||||||
|
;; 2. Resolve the issue of random half-screen jumps during scrolling.
|
||||||
|
(setq auto-window-vscroll nil)
|
||||||
|
|
||||||
|
;; Trigger scrolling when the cursor is 1 line from the window edge.
|
||||||
|
(setq scroll-margin 1)
|
||||||
|
|
||||||
|
;; Horizontal scrolling
|
||||||
(setq hscroll-margin 2
|
(setq hscroll-margin 2
|
||||||
hscroll-step 1
|
hscroll-step 1)
|
||||||
;; Emacs spends excessive time recentering the screen when the cursor
|
|
||||||
;; moves more than N lines past the window edges (where N is the value of
|
|
||||||
;; `scroll-conservatively`). This can be particularly slow in larger files
|
|
||||||
;; during extensive scrolling. If `scroll-conservatively` is set above
|
|
||||||
;; 100, the window is never automatically recentered. The default value of
|
|
||||||
;; 0 triggers recentering too aggressively. Setting it to 10 reduces
|
|
||||||
;; excessive recentering and only recenters the window when scrolling
|
|
||||||
;; significantly off-screen.
|
|
||||||
scroll-conservatively 10
|
|
||||||
scroll-margin 0
|
|
||||||
;; Reduce cursor lag by preventing automatic adjustments to
|
|
||||||
;; `window-vscroll' for unusually long lines. Setting
|
|
||||||
;; `auto-window-vscroll' it to nil also resolves the issue of random
|
|
||||||
;; half-screen jumps during scrolling.
|
|
||||||
auto-window-vscroll nil)
|
|
||||||
|
|
||||||
;;; Mouse Scroll
|
;;; Mouse Scroll
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user