1 ;;; hydra-examples.el --- some applications for hydra
3 ;; Copyright (C) 2015 Oleh Krehel
5 ;; This file is not part of GNU Emacs
7 ;; This file is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
12 ;; This program is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; For a full copy of the GNU General Public License
18 ;; see <http://www.gnu.org/licenses/>.
23 ;; These are the sample Hydras that you can use.
29 (defvar hydra-example-text-scale
30 '(("g" . text-scale-increase)
31 ("l" . text-scale-decrease))
32 "A two-headed hydra for text scale manipulation.")
36 (defun hydra-move-splitter-left ()
37 "Move window splitter left."
39 (if (windmove-find-other-window 'right)
40 (shrink-window-horizontally 1)
41 (enlarge-window-horizontally 1)))
43 (defun hydra-move-splitter-right ()
44 "Move window splitter right."
46 (if (windmove-find-other-window 'right)
47 (enlarge-window-horizontally 1)
48 (shrink-window-horizontally 1)))
50 (defun hydra-move-splitter-up ()
51 "Move window splitter up."
53 (if (windmove-find-other-window 'up)
57 (defun hydra-move-splitter-down ()
58 "Move window splitter down."
60 (if (windmove-find-other-window 'up)
64 (defvar hydra-example-move-window-splitter
65 '(("h" . hydra-move-splitter-left)
66 ("j" . hydra-move-splitter-down)
67 ("k" . hydra-move-splitter-up)
68 ("l" . hydra-move-splitter-right)))
70 (provide 'hydra-examples)
72 ;;; hydra-examples.el ends here