From 31271e90fc24cb1c551a17f00514a205210760dc Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Tue, 7 May 2024 14:13:02 +0100 Subject: [PATCH] Add a very basic embark support --- nix/modules/editor/default.nix | 1 + nix/modules/editor/lisp/fg42/editor.el | 36 ++++++++++++++++--- nix/modules/minibuffer-vertico/default.nix | 1 + .../lisp/fg42/minibuffer-vertico.el | 6 ++++ 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/nix/modules/editor/default.nix b/nix/modules/editor/default.nix index ee133fd..4741e5c 100644 --- a/nix/modules/editor/default.nix +++ b/nix/modules/editor/default.nix @@ -44,6 +44,7 @@ let beacon hydra rg + embark ]); drv = makeFG42Drv { diff --git a/nix/modules/editor/lisp/fg42/editor.el b/nix/modules/editor/lisp/fg42/editor.el index 65d2f1a..673c64f 100644 --- a/nix/modules/editor/lisp/fg42/editor.el +++ b/nix/modules/editor/lisp/fg42/editor.el @@ -41,13 +41,39 @@ (set-face-attribute 'default t :font name))) - -(use! origami - "A text folding minor mode for Emacs." +(use! embark + "Emacs Mini-Buffer Actions Rooted in Keymaps." :bind - (("C-c TAB" . origami-toggle-node)) + (("C--" . embark-act) ;; pick some comfortable binding + ("C-;" . embark-dwim) ;; good alternative: M-. + ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' + + :init + ;; Optionally replace the key help with a completing-read interface + (setq prefix-help-command #'embark-prefix-help-command) + + ;; Show the Embark target at point via Eldoc. You may adjust the + ;; Eldoc strategy, if you want to see the documentation from + ;; multiple providers. Beware that using this can be a little + ;; jarring since the message shown in the minibuffer can be more + ;; than one line, causing the modeline to move up and down: + + ;; (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target) + ;; (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly) :config - (global-origami-mode t)) + ;; Hide the mode line of the Embark live/completions buffers + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + + + (use! origami + "A text folding minor mode for Emacs." + :bind + (("C-c TAB" . origami-toggle-node)) + :config + (global-origami-mode t)) (use! rg diff --git a/nix/modules/minibuffer-vertico/default.nix b/nix/modules/minibuffer-vertico/default.nix index d8318d8..ee47d0a 100644 --- a/nix/modules/minibuffer-vertico/default.nix +++ b/nix/modules/minibuffer-vertico/default.nix @@ -31,6 +31,7 @@ let ctrlf consult marginalia + embark-consult ] ++ lib.optionals (cfg.floating) [ vertico-posframe ]); diff --git a/nix/modules/minibuffer-vertico/lisp/fg42/minibuffer-vertico.el b/nix/modules/minibuffer-vertico/lisp/fg42/minibuffer-vertico.el index 3010f51..5af3af1 100644 --- a/nix/modules/minibuffer-vertico/lisp/fg42/minibuffer-vertico.el +++ b/nix/modules/minibuffer-vertico/lisp/fg42/minibuffer-vertico.el @@ -204,6 +204,12 @@ match all of the components in any order." :bind (("M-g e" . consult-compile-error)))) +(use! embark-consult + "Embark integration for consult" + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + + (with-config "graphics" (use! nerd-icons-completion "Nerd icons in marginalia"