From: Peng Li Date: Tue, 22 Sep 2015 14:03:32 +0000 (+0800) Subject: emacs - add a function conbining helm-mini and helm-projectile-switch-buffers X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=14f5f59d75404c3c5f24fde3709272a006d434ce;hp=-c;p=dotfiles.git emacs - add a function conbining helm-mini and helm-projectile-switch-buffers --- 14f5f59d75404c3c5f24fde3709272a006d434ce diff --git a/emacs.d/config/init-evil.el b/emacs.d/config/init-evil.el index 549c4d1..96aac9d 100644 --- a/emacs.d/config/init-evil.el +++ b/emacs.d/config/init-evil.el @@ -30,12 +30,12 @@ ;; in emacs mode, Esc + s + x, the same (global-evil-leader-mode) (evil-leader/set-leader "s") -(evil-leader/set-key "j" 'helm-projectile-switch-to-buffer) +(evil-leader/set-key "j" 'pl-switch-buffers) (evil-leader/set-key "h" 'persp-switch) (evil-leader/set-key "k" 'helm-cmd-t) ;(evil-leader/set-key "f" 'helm-ls-git-ls) (evil-leader/set-key "b" 'helm-mini) -;(evil-leader/set-key "j" 'helm-mini) +(evil-leader/set-key "m" 'helm-mini) ;(evil-leader/set-key "p" 'helm-projectile-switch-project) ;(define-key evil-normal-state-map "M-n" 'persp-next) diff --git a/emacs.d/config/init-key-binding.el b/emacs.d/config/init-key-binding.el index 6b303fc..46aec50 100644 --- a/emacs.d/config/init-key-binding.el +++ b/emacs.d/config/init-key-binding.el @@ -25,7 +25,7 @@ ;; Esc s or M-s as prefix key (pl-make-keymap "\M-s" - '(("j" . helm-projectile-switch-to-buffer) + '(("j" . pl-switch-buffers) ("h" . persp-switch) ("k" . helm-cmd-t) ("w" . save-buffer) @@ -35,6 +35,14 @@ ("o" . occur) ("b" . helm-find-files))) +;; if current is not a project, useing helm-mini instead +(defun pl-switch-buffers () + (interactive) + (if (projectile-project-p) + (helm-projectile-switch-to-buffer) + (helm-mini))) + + ;(setq key-chord-two-keys-delay 0.2) ;; from emacs conference 2015 workshop (defun keychord-keymap (keychord bindings)