~ruther/emacs.d

ee196ed560e635e1580fa090381adddb9a89d400 — Rutherther 5 months ago dd3cc3a
feat: replace golden-ratio in favor of zoom-window
1 files changed, 12 insertions(+), 56 deletions(-)

M init.el
M init.el => init.el +12 -56
@@ 656,64 656,20 @@
                (this-command command))
            (call-interactively command)))))))

(my-use-package golden-ratio
(my-use-package zoom-window
  :ensure t
  :demand t
  :custom
  (golden-ratio-exclude-buffer-regexp
   '(
     "dape"
    "^\\*eldoc"))
  (golden-ratio-exclude-modes '("ediff-mode"))
  (golden-ratio-extra-commands '(
                                 ;; ace-window
                                 ace-window
                                 ace-swap-window
                                 ace-delete-window
                                 ace-select-window
                                 ;; magit
                                 ;; TODO: but there is something...
                                 ;; evil
                                 evil-window-left
                                 evil-window-right
                                 evil-window-up
                                 evil-window-down
                                 buf-move-left
                                 buf-move-right
                                 buf-move-up
                                 buf-move-down
                                 window-number-select
                                 select-window
                                 select-window-1
                                 select-window-2
                                 select-window-3
                                 select-window-4
                                 select-window-5
                                 select-window-6
                                 select-window-7
                                 select-window-8
                                 select-window-9))
  ;; Work with which-key
  (golden-ratio-inhibit-functions '(
                                    (lambda () (and which-key--buffer
                                                    (window-live-p (get-buffer-window which-key--buffer))))
                                    pl/ediff-comparison-buffer-p
                                    ))
  :hook
  (ediff-startup . my-ediff-startup-hook)
  :init
  (defun my-ediff-startup-hook ()
    "Workaround to balance the ediff windows when golden-ratio is enabled."
    ;; There's probably a better way to do it.
    (ediff-toggle-split)
    (ediff-toggle-split))

  (defun pl/ediff-comparison-buffer-p ()
  (and (boundp 'ediff-this-buffer-ediff-sessions)
       ediff-this-buffer-ediff-sessions))
  :general
  (my-leader
    "z" '(zoom-window-zoom :wk "Zoom current window")
    "Z" '(zoom-window-next :wk "Zoom next window")))

(my-use-package winner-mode
  :general
  (my-leader
    "j j" '(winner-undo :wk "Winner undo")
    "j k" '(winner-redo :wk "Winner redo"))
  :config
  (golden-ratio-mode 1)
  )
  (winner-mode))

(my-use-package savehist
  :ensure nil

Do not follow this link