diff options
-rw-r--r-- | init.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/init.el b/init.el index ddf2708..89c3ecd 100644 --- a/init.el +++ b/init.el | |||
@@ -603,11 +603,21 @@ like a dumbass." | |||
603 | (fset 'yes-or-no-p #'y-or-n-p)) | 603 | (fset 'yes-or-no-p #'y-or-n-p)) |
604 | 604 | ||
605 | (setup page | 605 | (setup page |
606 | (defun recenter-to-top (&rest _args) | 606 | |
607 | (:option page-delimiter | ||
608 | (rx bol (or "\f" ";;;") | ||
609 | (not (any "#")) (* not-newline) "\n" | ||
610 | (* (* blank) (opt ";" (* not-newline)) "\n"))) | ||
611 | |||
612 | (defun recenter-to-top (&rest _) | ||
607 | "Recenter the cursor to the top of the window." | 613 | "Recenter the cursor to the top of the window." |
608 | (recenter 0)) | 614 | (when (called-interactively-p 'any) |
615 | (recenter 5))) | ||
609 | (:advise forward-page :after #'recenter-to-top | 616 | (:advise forward-page :after #'recenter-to-top |
610 | backward-page :after #'recenter-to-top)) | 617 | backward-page :after #'recenter-to-top) |
618 | |||
619 | (:global "C-x C-n" forward-page | ||
620 | "C-x C-p" backward-page)) | ||
611 | 621 | ||
612 | (setup prog | 622 | (setup prog |
613 | (:option smie-indent-basic tab-width) | 623 | (:option smie-indent-basic tab-width) |