I am trying to have a simple solution to center the cursor at all times. I found that
centered-cursor-mode was too slow and found this simpler solution.
The only problem is mouse scrolling no longer works unless I disable the minor/major mode I implemented to center the cursor.
I tried to advise
mwheel-scroll to disable the mode but that was unsuccessful. I am not sure what I am doing wrong.
(define-minor-mode centered-point-mode "Always center the cursor on the screen." :lighter "..." (cond (centered-point-mode (add-hook 'post-command-hook 'line-change)) (t (remove-hook 'post-command-hook 'line-change)))) (defun line-change () (recenter)) (define-globalized-minor-mode my-global-centered-point-mode centered-point-mode (lambda () (centered-point-mode 1))) (my-global-centered-point-mode 1) (defun disable-centered (interactive) (centered-point-mode -1)) (advice-add 'mwheel-scroll :before (lambda () (interactive) (call-interactively 'disable-centered)))