Enable scrolling half a screen with C-v and M-v keybindings

This commit is contained in:
2012-12-14 13:14:05 +00:00
parent a4cf319cbf
commit fa9d696806
2 changed files with 21 additions and 0 deletions

View File

@@ -70,6 +70,23 @@ there's a region, all lines that region covers will be duplicated."
(yank-pop (- arg)))
;;
;; Scroll Half Screen
;; - from: http://www.emacswiki.org/emacs/HalfScrolling
;;
(defun window-half-height ()
(max 1 (/ (1- (window-height (selected-window))) 2)))
(defun scroll-up-half ()
(interactive)
(scroll-up (window-half-height)))
(defun scroll-down-half ()
(interactive)
(scroll-down (window-half-height)))
;;
;; Window Switching
;;

View File

@@ -24,6 +24,10 @@
;; Goto line
(global-set-key (kbd "C-c C-l") 'goto-line)
;; Scroll up/down
(global-set-key (kbd "C-v") 'scroll-up-half)
(global-set-key (kbd "M-v") 'scroll-down-half)
;; Switch to next/previous buffer
(global-set-key (kbd "C-c C-n") 'switch-to-next-buffer)
(global-set-key (kbd "C-c C-p") 'switch-to-prev-buffer)