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=d23250eb5c8c5e3e5190f0f53c6d062d4f2f169d;p=dotfiles.git emacs - add a function conbining helm-mini and helm-projectile-switch-buffers --- 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)