mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
I should really read documentation more...
This commit is contained in:
parent
2631db3ad8
commit
675047fdad
1 changed files with 3 additions and 20 deletions
|
|
@ -295,34 +295,17 @@
|
||||||
#+end_src
|
#+end_src
|
||||||
* navigation
|
* navigation
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Scrollkeeper is helpful for scrolling up and down
|
(setq next-screen-context-lines 30)
|
||||||
(defvar window-third-height nil)
|
|
||||||
|
|
||||||
(defun update-window-third-height (win &rest args)
|
(defun update-window-third-height (win &rest args)
|
||||||
;; (message "Updating window height for %s" (window-buffer win))
|
;; (message "Updating window height for %s" (window-buffer win))
|
||||||
(setq window-third-height
|
(setq next-screen-context-lines
|
||||||
(max 1 (/ (window-height win) 3))))
|
(max 1 (* 2 (/ (window-height win) 3)))))
|
||||||
|
|
||||||
(advice-add #'select-window
|
(advice-add #'select-window
|
||||||
:after
|
:after
|
||||||
'update-window-third-height)
|
'update-window-third-height)
|
||||||
|
|
||||||
(defun scroll-up-third ()
|
|
||||||
(interactive)
|
|
||||||
;; (pulse-momentary-highlight-one-line (point))
|
|
||||||
(scroll-up (or window-third-height 10)))
|
|
||||||
|
|
||||||
(defun scroll-down-third ()
|
|
||||||
(interactive)
|
|
||||||
;; (pulse-momentary-highlight-one-line (point))
|
|
||||||
(scroll-down (or window-third-height 10)))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-v") 'scroll-up-third)
|
|
||||||
(global-set-key (kbd "M-v") 'scroll-down-third)
|
|
||||||
;; (use-package scrollkeeper)
|
|
||||||
;; (global-set-key (kbd "C-v") 'scrollkeeper-down)
|
|
||||||
;; (global-set-key (kbd "M-v") 'scrollkeeper-up)
|
|
||||||
|
|
||||||
;; Word navigation
|
;; Word navigation
|
||||||
(global-set-key (kbd "M-f") 'forward-to-word)
|
(global-set-key (kbd "M-f") 'forward-to-word)
|
||||||
(global-set-key (kbd "M-F") 'forward-word)
|
(global-set-key (kbd "M-F") 'forward-word)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue