summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2018-04-12 08:57:20 -0700
committerFranck Cuny <franck.cuny@gmail.com>2018-04-12 08:57:20 -0700
commit4879b79fee10631a5313aa6984453a0ad8d11f89 (patch)
treebdea9310d0d53d3279eb49b647dce319756dfbd1
parent[emacs] Add smart-mode-line and a larger fringe. (diff)
downloademacs.d-4879b79fee10631a5313aa6984453a0ad8d11f89.tar.gz
[emacs] Add hydra for projectile.
-rw-r--r--emacs.d/modules/module-project.el44
1 files changed, 44 insertions, 0 deletions
diff --git a/emacs.d/modules/module-project.el b/emacs.d/modules/module-project.el
index 893f135..bc0bdf9 100644
--- a/emacs.d/modules/module-project.el
+++ b/emacs.d/modules/module-project.el
@@ -1,8 +1,52 @@
(require 'config-package)
+(defhydra hydra-projectile-other-window (:color teal)
+ "projectile-other-window"
+ ("f" projectile-find-file-other-window "file")
+ ("g" projectile-find-file-dwim-other-window "file dwim")
+ ("d" projectile-find-dir-other-window "dir")
+ ("b" projectile-switch-to-buffer-other-window "buffer")
+ ("q" nil "cancel" :color blue))
+
+(defhydra hydra-projectile (:color blue :hint nil)
+ "
+ PROJECTILE: %(projectile-project-root)
+ Find File Search/Tags Buffers Cache
+------------------------------------------------------------------------------------------
+_s-f_: file _a_: ag _i_: Ibuffer _c_: cache clear
+ _ff_: file dwim _g_: update gtags _b_: switch to buffer _x_: remove known project
+ _fd_: file curr dir _o_: multi-occur _s-k_: Kill all buffers _X_: cleanup non-existing
+ _r_: recent file ^^^^_z_: cache current
+ _d_: dir
+"
+ ("a" projectile-ag)
+ ("b" projectile-switch-to-buffer)
+ ("c" projectile-invalidate-cache)
+ ("d" projectile-find-dir)
+ ("s-f" projectile-find-file)
+ ("ff" projectile-find-file-dwim)
+ ("fd" projectile-find-file-in-directory)
+ ("g" ggtags-update-tags)
+ ("s-g" ggtags-update-tags)
+ ("i" projectile-ibuffer)
+ ("K" projectile-kill-buffers)
+ ("s-k" projectile-kill-buffers)
+ ("m" projectile-multi-occur)
+ ("o" projectile-multi-occur)
+ ("s-p" projectile-switch-project "switch project")
+ ("p" projectile-switch-project)
+ ("s" projectile-switch-project)
+ ("r" projectile-recentf)
+ ("x" projectile-remove-known-project)
+ ("X" projectile-cleanup-known-projects)
+ ("z" projectile-cache-current-file)
+ ("`" hydra-projectile-other-window/body "other window")
+ ("q" nil "cancel" :color blue))
+
(use-package projectile
:diminish projectile-mode
:bind-keymap ("C-c p" . projectile-command-map)
+ :bind (("C-c C-p" . hydra-projectile/body))
:init
(add-hook 'after-init-hook #'projectile-mode)