From b4e1b2130c7cf80f2b2ea58ddf493e6e4ffad03e Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Tue, 16 Feb 2021 20:16:29 -0600 Subject: [PATCH] refactor(selectrum): Move evil bindings where they belong --- modules/completion/selectrum/TODO.org | 1 + modules/completion/selectrum/config.el | 24 +---------------------- modules/config/default/+evil-bindings.el | 25 +++++++++++++++++++++++- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/modules/completion/selectrum/TODO.org b/modules/completion/selectrum/TODO.org index fc323233e..c132710d4 100644 --- a/modules/completion/selectrum/TODO.org +++ b/modules/completion/selectrum/TODO.org @@ -2,3 +2,4 @@ ** TODO SPC-s-p ** TODO SPC-s-b ** TODO Start-up with recent files +** TODO Add vanilla keybindings diff --git a/modules/completion/selectrum/config.el b/modules/completion/selectrum/config.el index f51312e6c..e835aaa46 100644 --- a/modules/completion/selectrum/config.el +++ b/modules/completion/selectrum/config.el @@ -12,18 +12,7 @@ :config (defadvice! +selectrum-refresh-on-cycle (&rest _) :after 'marginalia-cycle - (when (bound-and-true-p selectrum-mode) (selectrum-exhibit))) - - (map! - :g "C-s-r" #'selectrum-repeat - (:map selectrum-minibuffer-map - :geni "M-RET" #'selectrum-submit-exact-input - :geni "C-j" #'selectrum-next-candidate - :geni "C-S-j" #'selectrum-next-page - :geni "C-s-j" #'selectrum-goto-end - :geni "C-k" #'selectrum-previous-candidate - :geni "C-S-k" #'selectrum-previous-page - :geni "C-s-k" #'selectrum-goto-beginning))) + (when (bound-and-true-p selectrum-mode) (selectrum-exhibit)))) (use-package! selectrum-prescient :when (featurep! +prescient) @@ -79,17 +68,6 @@ (use-package! embark :defer t :init - (map! - :g "C-s-e" #'embark-act - (:map minibuffer-local-completion-map - "C-c C-o" #'embark-export - "C-c C-c" #'embark-act-noexit) - (:map embark-file-map - :desc "Open Dired on target" :g "j" #'ffap-dired - :desc "Open target with sudo" :g "s" #'sudo-edit - :desc "Open target with vlf" :g "l" #'vlf) - (:map embark-file-map - :desc "Cycle marginalia views" :g "A" #'marginalia-cycle)) (setq embark-action-indicator (lambda (map) (which-key--show-keymap "Embark" map nil nil 'no-paging) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index fb7dedcc4..84ae69aa8 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -200,7 +200,30 @@ (:after helm-occur :map helm-occur-map [C-return] #'helm-occur-run-goto-line-ow) (:after helm-grep :map helm-grep-map - [C-return] #'helm-grep-run-other-window-action))) + [C-return] #'helm-grep-run-other-window-action)) + + (:when (featurep! :completion selectrum) + (:after selectrum + "C-s-r" #'selectrum-repeat + :map selectrum-minibuffer-map + "M-RET" #'selectrum-submit-exact-input + "C-j" #'selectrum-next-candidate + "C-S-j" #'selectrum-next-page + "C-s-j" #'selectrum-goto-end + "C-k" #'selectrum-previous-candidate + "C-S-k" #'selectrum-previous-page + "C-s-k" #'selectrum-goto-beginning) + (:after embark + "C-o" #'embark-act + :map minibuffer-local-completion-map + "C-c C-o" #'embark-export + "C-c C-c" #'embark-act-noexit + :map embark-file-map + :desc "Open Dired on target" "j" #'ffap-dired + :desc "Open target with sudo" "s" #'sudo-edit + :desc "Open target with vlf" "l" #'vlf + :map embark-file-map + :desc "Cycle marginalia views" "A" #'marginalia-cycle))) ;;; :ui (map! (:when (featurep! :ui popup)