home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit a4c420fea64dde9dcf8fb53b8da7c77ed2a2759c
parent 7e3990906f9fea169b74da0534c75171880f415d
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Sat, 15 Apr 2023 04:01:12 +0200

tools/emacs: re-enable embark…

… base configuration on oantolin

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mtools/emacs/config/config-completion.el | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+), 0 deletions(-)

diff --git a/tools/emacs/config/config-completion.el b/tools/emacs/config/config-completion.el @@ -3,5 +3,80 @@ ;;; Setup completion framework ;;; Code +;; https://github.com/oantolin/embark/blob/master/embark-consult.el +(use-package embark + :unless noninteractive + :bind + ("C-." . embark-act) + ("M-." . embark-dwim) + ("C-h b" . embark-bindings) + ("C-h B" . embark-bindings-at-point) + ("C-h M" . embark-bindings-in-keymap) + ("C-h E" . embark-on-last-message) + (:map completion-list-mode-map + ("." . embark-act)) + (:map embark-collect-mode-map + ("a") ; I don't like my own default :) + ("." . embark-act) + ("F" . consult-focus-lines)) + (:map embark-package-map + ("t" . try)) + (:map embark-identifier-map + ("(" . insert-parentheses) + ("[" . insert-pair-map)) + (:map embark-expression-map + ("(" . insert-parentheses) + ("[" . insert-pair-map)) + (:map embark-region-map + ("(" . insert-parentheses) + ("[" . insert-pair-map) + ("D" . dictionary-search)) + (:map embark-email-map + ("+" . add-email-to-ecomplete) + ("\\" . remove-email-from-ecomplete)) + (:map embark-encode-map + ("p" . topaz-paste-region)) + (:map embark-url-map + ("x" . browse-url-generic) + ("p" . pocket-lib-add-urls)) + (:map embark-identifier-map + ("D" . dictionary-lookup-definition)) + :custom + (embark-quit-after-action nil) + (prefix-help-command #'embark-prefix-help-command) + (embark-indicators '(embark-minimal-indicator + embark-highlight-indicator + embark-isearch-highlight-indicator)) + (embark-cycle-key ".") + (embark-help-key "?") + (embark-confirm-act-all nil) + :config + (setq embark-candidate-collectors + (cl-substitute 'embark-sorted-minibuffer-candidates + 'embark-minibuffer-candidates + embark-candidate-collectors)) + (dolist (cmd '(comment-dwim + insert-parentheses + insert-pair + markdown-insert-code + markdown-insert-italic + markdown-insert-bold + org-emphasize + cdlatex-math-modify + TeX-font)) + (push #'embark--mark-target (alist-get cmd embark-around-action-hooks))) + (push #'embark--xref-push-marker + (alist-get 'find-file embark-pre-action-hooks)) + (defun embark-on-last-message (arg) + "Act on the last message displayed in the echo area." + (interactive "P") + (with-current-buffer "*Messages*" + (goto-char (1- (point-max))) + (embark-act arg)))) + +(use-package embark-consult + :unless noninteractive) + + (provide 'config-completion) ;;; config-completion.el ends here