summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-10-21 00:39:37 -0400
committerKyle Meyer <kyle@kyleam.com>2015-10-21 00:39:37 -0400
commit03ed47268f763ea6942daaceffaa0c502100f90f (patch)
tree9f8424563b61bb8b17051e4f22a6ff1cdfc47075 /lisp
parent71c7636bc27d1fe1acbde3fff1a4e28079830074 (diff)
downloademacs.d-03ed47268f763ea6942daaceffaa0c502100f90f.tar.gz
Use hydra for window map
Switching the window split is often followed by a window swap, so it is nice to be able to do this with a single key. winner-undo is also repeated often.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-framewin.el24
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/init-framewin.el b/lisp/init-framewin.el
index ec9ac02..43316fe 100644
--- a/lisp/init-framewin.el
+++ b/lisp/init-framewin.el
@@ -38,16 +38,24 @@ Assumes that the window is only split into two."
(split-window-vertically))
(switch-to-buffer nil)))
-(global-set-key (kbd "M-o") 'scroll-other-window)
+(defhydra hydra-window-map (:hint nil)
+ "
+_l_: Switch split _r_: Winner redo _o_: Scroll other
+_s_: Swap _u_: Winner undo _i_: Scroll other down
+\n"
+ ("l" km/switch-window-split)
+ ("s" km/swap-windows)
-(define-prefix-command 'km/window-map)
-(global-set-key (kbd "C-c w") 'km/window-map)
+ ("r" winner-redo)
+ ("u" winner-undo)
-(define-key km/window-map "f" 'make-frame)
-(define-key km/window-map "l" 'km/switch-window-split)
-(define-key km/window-map "r" 'winner-redo)
-(define-key km/window-map "s" 'km/swap-windows)
-(define-key km/window-map "u" 'winner-undo)
+ ("o" scroll-other-window)
+ ("i" scroll-other-window-down)
+
+ ("f" make-frame "new frame" :color blue)
+ ("q" nil "quit"))
+
+(global-set-key (kbd "C-c w") 'hydra-window-map/body)
(key-chord-define-global "lq" 'winner-undo)