Created
March 17, 2015 02:45
-
-
Save mpontus/3fe247a63118983b1f5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (setq-default scroll-up-aggressively 0.0) | |
| (add-hook 'post-command-hook | |
| (defun recenter+ () | |
| (unless (and (symbolp this-command) (get this-command 'scroll-command)) | |
| (with-current-buffer (window-buffer) | |
| (recenter (- (1+ (save-excursion | |
| (vertical-motion (floor (window-screen-lines) 2)))))))))) | |
| (define-key global-map [remap scroll-down-command] | |
| (defun move-to-top-line () (interactive) (move-to-window-line 1))) | |
| (define-key global-map [remap scroll-up-command] | |
| (defun move-to-bottom-line () (interactive) (move-to-window-line -1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment