From b9e34835c71684974ad8249b1e6a4e7c7701b723 Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Thu, 29 Apr 2021 12:32:04 +0300 Subject: [PATCH] selectrum: update bindings --- modules/completion/selectrum/config.el | 15 +++++++++++++-- modules/config/default/+emacs-bindings.el | 2 ++ modules/config/default/+evil-bindings.el | 14 +------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/completion/selectrum/config.el b/modules/completion/selectrum/config.el index a6f28bd85..9a027c7c5 100644 --- a/modules/completion/selectrum/config.el +++ b/modules/completion/selectrum/config.el @@ -13,7 +13,10 @@ selectrum-max-window-height 17) (defadvice! +selectrum-refresh-on-cycle (&rest _) :after 'marginalia-cycle - (when (bound-and-true-p selectrum-mode) (selectrum-exhibit)))) + (when (bound-and-true-p selectrum-mode) (selectrum-exhibit))) + (map! :map selectrum-minibuffer-map + "C-o" #'embark-act + "C-c C-o" #'embark-export)) (use-package! selectrum-prescient :when (featurep! +prescient) @@ -70,7 +73,8 @@ [remap switch-to-buffer] #'consult-buffer [remap switch-to-buffer-other-window] #'consult-buffer-other-window [remap switch-to-buffer-other-frame] #'consult-buffer-other-frame - [remap yank-pop] #'consult-yank-pop) + [remap yank-pop] #'consult-yank-pop + [remap describe-bindings] #'embark-bindings) :config (recentf-mode) (setq consult-project-root-function #'doom-project-root) @@ -101,6 +105,13 @@ #'which-key--hide-popup-ignore-command) embark-become-indicator embark-action-indicator) :config + (map! + :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 ) (let ((embark-quit-after-action nil)) (map! :map minibuffer-local-map "C-SPC" #'embark-default-action))) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index 39807c336..1d23d90ea 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -452,6 +452,8 @@ (:when (featurep! :completion helm) "C-S-s" #'swiper-helm "C-S-r" #'helm-resume) + (:when (featurep! :completion selectrum) + "C-S-r" #'selectrum-repeat) ;;; objed (:when (featurep! :editor objed +manual) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 3c4e85040..945c5b8c1 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -204,7 +204,6 @@ (: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 @@ -212,18 +211,7 @@ "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))) + "C-s-k" #'selectrum-goto-beginning))) ;;; :ui (map! (:when (featurep! :ui popup)