Closed ColemanGariety closed 4 years ago
I normally works as expected at the start of a file. There are however some modes have own scroll-commands like Info-mode
that binds Info-scroll-down
to S-SPC
that prevents scrolling to the top with centered-cursor-mode
. But your problem doesn't sound like that. Could you give some more information, like other mode that might be intervening?
@andre-r I have C-b
mapped to evil-scroll-page-up
, that's probably why. What's the best way to get it to scroll all the way up?
Try this in your init file:
(defun ccm-remap-evil-keys ()
(when (and centered-cursor-mode evil-mode)
;; up is down, evil doesn't follow the convention
(local-set-key [remap evil-scroll-page-up] 'ccm-scroll-down)
(local-set-key [remap evil-scroll-page-down] 'ccm-scroll-up)))
(add-hook 'evil-mode-hook 'ccm-remap-evil-keys)
(add-hook 'centered-cursor-mode-hook 'ccm-remap-evil-keys)
I am working (sporadically) on improvements, including compatibility with other packages. I'll make a note for evil-mode.
There's already an option to disable recentering at EOF, it would make a lot of sense if there were an equivalent option for centering at BOF as well. Presently, when
centered-cursor-mode
is enabled, it is not possible to get to the beginning of the file withPgUp
.