rename old emacs folder
[dotfiles.git] / emacs.d_old / elisp / init-hydra.el
1
2 ;; key mapping 
3 ;; TODO:
4 ;;    1. exec external progeam
5 ;;       prefix + s : eshell / term
6 ;;       prefix + p : package install
7 ;;       prefix +
8 ;;    2. prefix for magit
9 ;;
10 ;;    3. prefix for avy motion
11 ;;    4. window / buffer switch
12 ;;    5. file project switch
13 (use-package hydra
14   :ensure t
15   :config
16   (hydra-add-font-lock))
17
18
19 (defhydra hydra-external (global-map "<f2>")
20   "zoom"
21   ("g" text-scale-increase "in")
22   ("l" text-scale-decrease "out")
23   )
24
25
26 ;; hydra for Misc commands
27 (defhydra hydra-misc (:exit t)
28   "Misc Commands" 
29   ("e" eshell "eshell" :color red)
30   ("p" (lambda ()
31          (interactive)
32          (if (pl/buffer-exist "*Packages*")
33              (switch-to-buffer "*Packages*")
34            (package-list-packages)))
35    "List-package" :color red)
36   )
37 (defun pl/buffer-exist (bufname) (not (eq nil (get-buffer bufname))))
38 (global-set-key (kbd "<f3>") 'hydra-misc/body)
39
40
41
42
43
44
45
46 (provide 'init-hydra)