From a9485fb0ed397258a1ea7e5023508c583c78492e Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 7 Sep 2015 22:42:44 +0800 Subject: [PATCH] emacs - add hydry ace-windows --- emacs.d/config/init-hydra.el | 55 +++++++++++++++++++++++++++++++++++--------- emacs.d/init.el | 4 ++++ 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/emacs.d/config/init-hydra.el b/emacs.d/config/init-hydra.el index 60693f7..50cc422 100644 --- a/emacs.d/config/init-hydra.el +++ b/emacs.d/config/init-hydra.el @@ -6,6 +6,8 @@ ;; windows layout restore / maximum ;; +;; misc such as +;; package-list-p, eval-buffer (defhydra hydra-helm (global-map "M-c") "Helm" @@ -20,6 +22,37 @@ ("l" text-scale-decrease "out")) +(global-set-key + (kbd "C-M-o") +; (kbd "M-p") + (defhydra hydra-window () + "window" + ("h" windmove-left) + ("j" windmove-down) + ("l" windmove-right) + ("k" windmove-up) + ("v" (lambda () + (interactive) + (split-window-right) + (windmove-right)) + "vert") + ("x" (lambda () + (interactive) + (split-window-below) + (windmove-down)) + "horz") + ("o" delete-other-windows "one" :color blue) + ("a" ace-window "ace") + ("s" ace-swap-window "swap") + ("d" ace-delete-window "del") + ("i" ace-maximize-window "ace-one" :color blue) + ("b" ido-switch-buffer "buf") + ("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo") + ("i" winner-undo "undo2") + ("q" nil "cancel"))) + +;; define C-space start mark + ;;** Example 2: move window splitter @@ -44,17 +77,17 @@ ;;** Example 4: toggle rarely used modes - (defvar whitespace-mode nil) - (global-set-key - (kbd "C-c C-v") - (defhydra hydra-toggle-simple (:color blue) - "toggle" - ("a" abbrev-mode "abbrev") - ("d" toggle-debug-on-error "debug") - ("f" auto-fill-mode "fill") - ("t" toggle-truncate-lines "truncate") - ("w" whitespace-mode "whitespace") - ("q" nil "cancel"))) +; (defvar whitespace-mode nil) +; (global-set-key +; (kbd "C-c C-v") +; (defhydra hydra-toggle-simple (:color blue) +; "toggle" +; ("a" abbrev-mode "abbrev") +; ("d" toggle-debug-on-error "debug") +; ("f" auto-fill-mode "fill") +; ("t" toggle-truncate-lines "truncate") +; ("w" whitespace-mode "whitespace") +; ("q" nil "cancel"))) diff --git a/emacs.d/init.el b/emacs.d/init.el index 2b6bda9..efd6193 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -137,3 +137,7 @@ (setq hydra-examples-verbatim t) (require 'init-hydra) + + +(require 'ace-window) +(global-set-key (kbd "M-p") 'ace-window) -- 2.11.0