]> code.delx.au - gnu-emacs-elpa/commitdiff
avy-jump.el (avy-setup-default): Setup some bindings
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 8 May 2015 13:20:08 +0000 (15:20 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 8 May 2015 13:22:21 +0000 (15:22 +0200)
* README.md: Add a description.

Fixes #10

README.md
avy-jump.el

index 47557427c7f8a66e0c7fe8578be173aa56721c1e..01bf587def4fb6e35a2831189b03bc74bce70044 100644 (file)
--- a/README.md
+++ b/README.md
@@ -76,3 +76,13 @@ After <kbd>M-g e</kbd>:
 ### Other commands
 
 There are some more commands which you can explore yourself by looking at the code.
+
+### Bindings
+
+You add this to your config to bind some stuff:
+
+```elisp
+(avy-setup-default)
+```
+
+It will bind, for example, `avy-isearch` to <kbd>C-'</kbd> in `isearch-mode-map`, so that you can select one of the currently visible `isearch` candidates using `avy`.
index 60b91609383f76a91395a68ef0ddb434a06b4fd7..d6bb52e797e476a218c0efc4faa9d7f8e6c3e705 100644 (file)
@@ -1,4 +1,4 @@
-;;; avy-jump.el --- jump to things tree-style
+;;; avy-jump.el --- jump to things tree-style. -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2015  Free Software Foundation, Inc.
 
@@ -437,6 +437,12 @@ ARG lines can be used."
           (line-end-position)))
        pad))))
 
+;;;###autoload
+(defun avy-setup-default ()
+  "Setup the default shortcuts."
+  (eval-after-load 'isearch
+    '(define-key isearch-mode-map (kbd "C-'") 'avy-isearch)))
+
 (define-obsolete-variable-alias 'avi-keys 'avy-keys "0.1.0")
 (define-obsolete-variable-alias 'avi-background 'avy-background "0.1.0")
 (define-obsolete-variable-alias 'avi-word-punc-regexp 'avy-word-punc-regexp "0.1.0")