+;; Misc commands
+(defhydra hydra-misc (:exit t)
+ "Misc commancs"
+ ("p" (lambda ()
+ (interactive)
+ (if (buffer-exists "*Packages*")
+ (switch-to-buffer "*Packages*")
+ (package-list-packages)))
+ "list-package" :color red)
+ ("e" eval-buffer "eval-buffer" :color red))
+
+(defun buffer-exists (bufname) (not (eq nil (get-buffer bufname))))
+(global-set-key (kbd "M-c") 'hydra-misc/body)
+
+(global-set-key
+; (kbd "C-M-o")
+ (kbd "M-o")
+ (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")
+ ("s" (lambda ()
+ (interactive)
+ (split-window-below)
+ (windmove-down))
+ "horz")
+ ("o" delete-other-windows "one" :color blue)
+ ("a" ace-window "ace")
+ ("w" 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")
+ ("q" nil "cancel")))
+
+;(defun pl-last-winner ()
+
+
+;;(defhydra hydra-launcher (:color blue :columns 2)
+;; "Launch"
+;; ("h" man "man")
+;; ("r" (browse-url "http://www.reddit.com/r/emacs/") "reddit")
+;; ("w" (browse-url "http://www.emacswiki.org/") "emacswiki")
+;; ("s" shell "shell")
+;; ("q" nil "cancel"))
+
+;; define C-space start mark