Skip to content
eflanigan00 edited this page Jul 1, 2017 · 2 revisions

Description:

Another option for an ace window hydra. I try to mimic the ace windows commands and call the hydra with C-x f ; when necessary.

Hydra(s):

;; hydra-frame-window is designed from ace-window (C-x f) and
;; matches aw-dispatch-alist with a few extra
(defhydra hydra-frame-window (:color red :hint nil)
  "
^Delete^                       ^Frame resize^             ^Window^                Window Size^^^^^^   ^Text^                         (__)
_0_: delete-frame              _g_: resize-frame-right    _t_: toggle               ^ ^ _k_ ^ ^        _K_                           (oo)
_1_: delete-other-frames       _H_: resize-frame-left     _e_: ace-swap-win         _h_ ^+^ _l_        ^+^                     /------\\/
_2_: make-frame                _F_: fullscreen            ^ ^                       ^ ^ _j_ ^ ^        _J_                    / |    ||
_d_: kill-and-delete-frame     _n_: new-frame-right       _w_: ace-delete-window    _b_alance^^^^      ^ ^                   *  /\\---/\\  ~~  C-x f ;
"
  ("0" delete-frame :exit t)
  ("1" delete-other-frames :exit t)
  ("2" make-frame  :exit t)
  ("b" balance-windows)
  ("d" kill-and-delete-frame :exit t)
  ("e" ace-swap-window)
  ("F" toggle-frame-fullscreen)   ;; is <f11>
  ("g" resize-frame-right :exit t)
  ("H" resize-frame-left :exit t)  ;; aw-dispatch-alist uses h, I rebind here so hjkl can be used for size
  ("n" new-frame-right :exit t)
  ;; ("r" reverse-windows)
  ("t" toggle-window-spilt)
  ("w" ace-delete-window :exit t)
  ("x" delete-frame :exit t)
  ("K" text-scale-decrease)
  ("J" text-scale-increase)
  ("h" shrink-window-horizontally)
  ("k" shrink-window)
  ("j" enlarge-window)
  ("l" enlarge-window-horizontally))

Ace Window Keys and Dispatch

 ;; ace-window uses home row
(setq aw-keys '(?a ?s ?d ?f ?j ?k ?l))

(setq aw-dispatch-alist
      '((?\; hydra-frame-window/body)
        (?0 delete-frame)
        (?1 delete-other-frames)
        (?2 make-frame)
        (?b balance-windows)
        (?e ace-swap-window)
        (?F toggle-frame-fullscreen)
        (?g resize-frame-left)
        (?h resize-frame-right)
        (?n new-frame-right)
        (?r reverse-windows)
        (?t toggle-window-spilt)
        (?x delete-frame)
        (?w ace-delete-window)
        ))
Clone this wiki locally