From 0e3b725b503301442b71b65efccf1bde54d260ec Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 22 Feb 2015 12:46:13 -0500 Subject: [PATCH] Make ido and helm micro-states persistent --- spacemacs/packages.el | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 9200e0491..e089caa1f 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1263,10 +1263,11 @@ which require an initialization must be listed explicitly in the list.") [h] [l] previous/next source [t] toggle visible mark [T] toggle all mark - [v] persistent action") - + [v] persistent action + [q] quit") (spacemacs|define-micro-state helm-navigation + :persistent t :on-enter (spacemacs//helm-navigation-ms-on-enter) :on-exit (spacemacs//helm-navigation-ms-on-exit) :bindings @@ -1274,12 +1275,14 @@ which require an initialization must be listed explicitly in the list.") ("C-@" nil :exit t) ("" helm-select-action :exit t) ("C-i" helm-select-action :exit t) + ("" helm-maybe-exit-minibuffer :exit t) ("?" nil :doc (spacemacs//helm-navigation-ms-full-doc)) ("a" helm-select-action :post (spacemacs//helm-navigation-ms-set-face)) ("h" helm-previous-source) ("j" helm-next-line) ("k" helm-previous-line) ("l" helm-next-source) + ("q" nil :exit t) ("t" helm-toggle-visible-mark) ("T" helm-toggle-all-marks) ("v" helm-execute-persistent-action)) @@ -1411,7 +1414,15 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default." :init (progn (ido-vertical-mode t) + + (defun spacemacs//ido-vertical-minibuffer-setup () + (when face-remapping-alist + (setq face-remapping-alist nil))) + (add-hook 'ido-minibuffer-setup-hook 'spacemacs//ido-vertical-minibuffer-setup) + (defun spacemacs//ido-vertical-define-keys () + (when face-remapping-alist + (setq face-remapping-alist nil)) ;; overwrite the key bindings for ido vertical mode only (define-key ido-completion-map (kbd "C-d") 'ido-delete-file-at-head) (define-key ido-completion-map (kbd "C-k") 'ido-prev-match) @@ -1442,7 +1453,7 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default." (define-key ido-completion-map (kbd "C-SPC") 'spacemacs/ido-navigation-micro-state) (define-key ido-completion-map (kbd "C-@") 'spacemacs/ido-navigation-micro-state) ) - (add-to-list 'ido-setup-hook 'spacemacs//ido-vertical-define-keys) + (add-hook 'ido-setup-hook 'spacemacs//ido-vertical-define-keys) (defface spacemacs-ido-navigation-ms-face `((t :background ,(face-attribute 'error :foreground) @@ -1476,14 +1487,17 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default." [o] open in other window [s] open in a new horizontal split [t] open in other frame - [v] open in a new vertical split") + [v] open in a new vertical split + [q] quit") (spacemacs|define-micro-state ido-navigation + :persistent t :on-enter (spacemacs//ido-navigation-ms-on-enter) :on-exit (spacemacs//ido-navigation-ms-on-exit) :bindings ("C-SPC" nil :exit t) ("C-@" nil :exit t) + ("" ido-exit-minibuffer) ("?" nil :doc (spacemacs//ido-navigation-ms-full-doc)) ("h" ido-delete-backward-updir) ("j" ido-next-match) @@ -1494,6 +1508,7 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default." ("n" ido-next-match-dir) ("o" ido-invoke-in-other-window) ("p" ido-prev-match-dir) + ("q" nil :exit t) ("s" ido-invoke-in-vertical-split) ("t" ido-invoke-in-new-frame) ("v" ido-invoke-in-horizontal-split)))))