feat(emacs.d): Enable edwina package for window management

Configures edwina using `s-w` as the key prefix (in line with my other
EXWM-related commands).

An additional function is added that switches to a buffer (borrowing
the implementation from `ivy-switch-buffer`) but splitting it into a
new window instead.
This commit is contained in:
Vincent Ambo 2019-12-24 15:30:25 +01:00
parent ccd31b8898
commit 86c2ebc096

View file

@ -44,6 +44,27 @@
(use-package dash)
(use-package dash-functional)
(use-package dottime :config (dottime-display-mode t))
(use-package edwina
:after (ace-window ivy)
:init
(setq edwina-keymap-prefix (kbd "s-w"))
(defun edwina-split-to-buffer ()
(interactive)
(ivy-read "Switch to buffer: " #'internal-complete-buffer
:keymap ivy-switch-buffer-map
:preselect (buffer-name (other-buffer (current-buffer)))
:action (lambda (buffer)
(let ((new-window (split-window-below)))
(edwina-arrange)
(with-selected-window new-window
(switch-to-buffer buffer nil 'force-same-window))))
:matcher #'ivy--switch-buffer-matcher
:caller 'ivy-switch-buffer))
:bind (:map edwina-mode-map
("s-w b" . #'edwina-split-to-buffer))
:config (edwina-mode 1))
(use-package gruber-darker-theme)
(use-package ht)
(use-package hydra)