[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0712a43 12/17: README.md: update
From: |
Oleh Krehel |
Subject: |
[elpa] master 0712a43 12/17: README.md: update |
Date: |
Tue, 10 Feb 2015 07:13:27 +0000 |
branch: master
commit 0712a436f0a98980cb973c83593bfb003d097d3c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
README.md: update
---
README.md | 41 +++++++++++++++++++++++++++--------------
1 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index 400a4ed..831dbb6 100644
--- a/README.md
+++ b/README.md
@@ -16,29 +16,42 @@ Hydra, will still serve his orignal purpose, calling his
proper
command. This makes the Hydra very seamless, it's like a minor mode
that disables itself auto-magically.
-## Simplified usage
-
-Here's how to quickly bind the examples bundled with Hydra:
+## Sample global Hydras
+### Zoom
```cl
-(require 'hydra-examples)
-(hydra-create "C-M-y" hydra-example-move-window-splitter)
-(hydra-create "M-g" hydra-example-goto-error)
-(hydra-create "<f2>" hydra-example-text-scale)
+(defhydra hydra-zoom (global-map "<f2>")
+ "zoom"
+ ("g" text-scale-increase "in")
+ ("l" text-scale-decrease "out"))
```
-## Using Hydra for global bindings
+### Goto-error
-But it's much better to just take the examples as a template and write
-down everything explicitly:
+```cl
+(defhydra hydra-error (global-map "M-g")
+ "goto-error"
+ ("h" first-error "first")
+ ("j" next-error "next")
+ ("k" previous-error "prev")
+ ("v" recenter-top-bottom "recenter")
+ ("q" nil "quit"))
+```
+
+### Splitter
```cl
-(defhydra hydra-zoom (global-map "<f2>")
- "zoom"
- ("g" text-scale-increase "in")
- ("l" text-scale-decrease "out"))
+(require 'hydra-examples)
+(defhydra hydra-splitter (global-map "C-M-s")
+ "splitter"
+ ("h" hydra-move-splitter-left)
+ ("j" hydra-move-splitter-down)
+ ("k" hydra-move-splitter-up)
+ ("l" hydra-move-splitter-right))
```
+## Using the functions generated by `defhydra`
+
With the example above, you can e.g.:
```cl
- [elpa] master 9991985 01/17: hydra-test.el: update the test to not fail for older Emacs, (continued)
- [elpa] master 9991985 01/17: hydra-test.el: update the test to not fail for older Emacs, Oleh Krehel, 2015/02/10
- [elpa] master 1660d71 05/17: Allow :pre and :post to be function symbols, Oleh Krehel, 2015/02/10
- [elpa] master 7ead8db 06/17: hydra.el (defhydra): Declare indent 2, Oleh Krehel, 2015/02/10
- [elpa] master 1b1d31d 07/17: Support local hydra heads, Oleh Krehel, 2015/02/10
- [elpa] master 9a8e2f1 04/17: hydra.el (hydra-keyboard-quit): New custom var, Oleh Krehel, 2015/02/10
- [elpa] master 9b31ead 08/17: Update semantics for local heads to `:bind nil', Oleh Krehel, 2015/02/10
- [elpa] master 969fa66 10/17: fix typo - single not singe, Oleh Krehel, 2015/02/10
- [elpa] master d41be74 11/17: `hydra/body' will pass the initial `current-prefix-arg' along, Oleh Krehel, 2015/02/10
- [elpa] master ad771a4 03/17: Move defun-creating code into a defun, Oleh Krehel, 2015/02/10
- [elpa] master 763bb2a 13/17: Allow lambda :bind property for body and heads, Oleh Krehel, 2015/02/10
- [elpa] master 0712a43 12/17: README.md: update,
Oleh Krehel <=
- [elpa] master d10c26e 14/17: Update comments and mark the old examples obsolete, Oleh Krehel, 2015/02/10
- [elpa] master 0c08964 16/17: README.md: update, Oleh Krehel, 2015/02/10
- [elpa] master 4ca646e 15/17: Allow a sexp as head's CMD paramater, Oleh Krehel, 2015/02/10
- [elpa] master bb01930 09/17: Fix "catch 'hydra-disable", Oleh Krehel, 2015/02/10
- [elpa] master 11b130e 17/17: Merge commit '0c08964462812942db51d177e6ea922b26019e65' from hydra, Oleh Krehel, 2015/02/10