commit 419661211fac616479cffab52a481456bae64868
parent 8c784e37c1920c746cd63dede2c56cbd03f196bc
Author: Vincent Demeester <vincent@sbr.pm>
Date: Thu, 25 Jun 2020 06:25:15 +0200
tools/emacs: configure embark 🙃
This is an awesome package, combined with icomplete it makes a really
nice completion framework.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
2 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/tools/emacs/config/config-buffers.el b/tools/emacs/config/config-buffers.el
@@ -20,6 +20,12 @@
(window-height . 0.25)
(side . bottom)
(slot . -1))
+ (".*\\*\\(Completions\\|Embark Live Occur\\).*"
+ (display-buffer-in-side-window)
+ (window-height . 0.16)
+ (side . bottom)
+ (slot . 0)
+ (window-parameters . ((no-other-window . t))))
("\\*\\(Backtrace\\|Warnings\\|Compile-Log\\|[Hh]elp\\|Messages\\)\\*"
(display-buffer-in-side-window)
(window-height . 0.25)
@@ -71,7 +77,9 @@
(display-buffer-in-side-window)
(window-width . 0.20)
(side . right)
- (slot . 2))))
+ (slot . 2))
+ ("\\*Embark Occur.*"
+ (display-buffer-at-bottom))))
(setq window-sides-vertical nil)
(setq window-combination-resize t) ; Size new windows proportionally
:bind (("C-x +" . balance-windows-area)
diff --git a/tools/emacs/config/config-completion.el b/tools/emacs/config/config-completion.el
@@ -244,6 +244,9 @@ normally would when calling `yank' followed by `yank-pop'."
(use-package embark
:load-path "~/.config/emacs/lisp/embark/" ; in development
+ :custom
+ (embark-occur-initial-view-alist '((t . grid)))
+ (completing-read-function 'embark-completing-read)
:config
(defun vde/embark-insert-exit ()
"Like `embark-insert' but exits current recursive minibuffer."
@@ -257,11 +260,41 @@ normally would when calling `yank' followed by `yank-pop'."
(with-minibuffer-selected-window (insert (embark-target)))
(top-level))
+ (setq embark-action-indicator
+ (propertize "[Act]" 'face
+ '(:inherit modus-theme-intense-blue :weight bold)))
+ (setq embark-become-indicator
+ (propertize "[Become]" 'face
+ '(:inherit modus-theme-intense-green :weight bold)))
+
:bind (:map minibuffer-local-completion-map
("M-o" . embark-act)
- :map embark-general-map
- ("m" . vde/embark-insert-exit)
- ("j" . vde/embark-insert-exit-all)))
+ ("C-c a" . embark-occur)
+ ("C-c x" . embark-export)
+ (:map minibuffer-local-map
+ (">" . embark-become))
+ (:map minibuffer-local-completion-map
+ (";" . embark-act-noexit)
+ (":" . embark-act)
+ ("C-o" . embark-occur)
+ ("C-l" . embark-live-occur) ; only here for crm, really
+ ("M-e" . embark-export)
+ ("M-q" . embark-occur-toggle-view)
+ ("M-v" . embark-switch-to-live-occur))
+ (:map completion-list-mode-map
+ (";" . embark-act))
+ (:map embark-occur-mode-map
+ ("a") ; I don't like my own default :)
+ (";" . embark-act)
+ ("'" . avy-embark-occur-choose)
+ ("\"" . avy-embark-occur-act))
+ (:map embark-package-map
+ ("g" . package-refresh-contents)
+ ("a" . package-autoremove)
+ ("t" . try))
+ (:map embark-general-map
+ ("m" . vde/embark-insert-exit)
+ ("j" . vde/embark-insert-exit-all))))
;; UseCompany
(use-package company