mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 08:14:15 +00:00
I like this a lot better
This commit is contained in:
parent
675047fdad
commit
89209e4fcf
1 changed files with 21 additions and 8 deletions
|
|
@ -295,16 +295,29 @@
|
|||
#+end_src
|
||||
* navigation
|
||||
#+begin_src emacs-lisp
|
||||
(setq next-screen-context-lines 30)
|
||||
(defun update-window-third-height (&optional arg)
|
||||
(let ((win
|
||||
(cond ((framep arg)
|
||||
(frame-selected-window arg))
|
||||
((windowp arg)
|
||||
arg)
|
||||
((null arg) (selected-window)))))
|
||||
;; (message "Updating window height for %s" (window-buffer win))
|
||||
(when (not (active-minibuffer-window))
|
||||
(setq next-screen-context-lines
|
||||
(max 1 (* 2 (/ (window-height win) 3)))))))
|
||||
|
||||
(defun update-window-third-height (win &rest args)
|
||||
;; (message "Updating window height for %s" (window-buffer win))
|
||||
(setq next-screen-context-lines
|
||||
(max 1 (* 2 (/ (window-height win) 3)))))
|
||||
(update-window-third-hook)
|
||||
|
||||
(advice-add #'select-window
|
||||
:after
|
||||
'update-window-third-height)
|
||||
(add-hook 'window-selection-change-functions
|
||||
#'update-window-third-height)
|
||||
|
||||
(add-hook 'window-configuration-change-hook
|
||||
#'update-window-third-height)
|
||||
|
||||
;; (advice-add #'select-window
|
||||
;; :after
|
||||
;; 'update-window-third-height)
|
||||
|
||||
;; Word navigation
|
||||
(global-set-key (kbd "M-f") 'forward-to-word)
|
||||
|
|
|
|||
Loading…
Reference in a new issue