mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Enable scrolling half a screen with C-v and M-v keybindings
This commit is contained in:
17
helpers.el
17
helpers.el
@@ -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
|
||||
;;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user