EBR: Hacky popper integration with the rotate window package

This commit is contained in:
Joseph Ferano 2022-08-25 12:22:48 +07:00
parent e063675ec7
commit 005d48b1c3

View File

@ -307,22 +307,46 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
#+begin_src emacs-lisp
(require 'winner)
(winner-mode t)
(straight-use-package 'rotate)
(setq joe/popper-side-toggle 'right)
(defun joe/window-split-vertical () (interactive) (set 'joe/popper-side-toggle 'right) (rotate:main-horizontal))
(defun joe/window-split-horizontal () (interactive) (set 'joe/popper-side-toggle 'below) (rotate:main-vertical))
(define-key ctl-x-4-map (kbd "|") #'joe/window-split-vertical)
(define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal)
(straight-use-package 'popper)
(require 'popper)
(setq popper-reference-buffers
'("\\*compilation\\*" compilation-mode
"^\\*vterm\\*" vterm-mode))
(setq popper-window-height 0.35)
(popper-mode t)
"^\\*vterm\\*" vterm-mode
("^\\*Warnings\\*$" . hide)
help-mode
helpful-mode))
(global-set-key (kbd "C-`") 'popper-toggle-latest)
(global-set-key (kbd "M-`") 'popper-cycle)
(global-set-key (kbd "C-M-`") 'popper-toggle-type)
(require 'popper-echo)
(popper-echo-mode t)
;; (setq popper-display-control nil)
;; (setq popper-display-function #'display-buffer-in-child-frame)
(defun joe/get-popper-dir ()
(if (> (window-width) 170)
joe/popper-side-toggle
'below))
(defun joe/popper-display-func (buffer &optional _alist)
(display-buffer-in-direction
buffer
`((window-height . 0.4)
(window-width . 0.4)
(direction . ,(joe/get-popper-dir))
(body-function . ,#'select-window))))
(setq popper-display-function #'joe/popper-display-func)
(popper-mode t)
#+end_src
** Org Mode