Replace ace-jump-mode with avy

This commit is contained in:
Bozhidar Batsov 2015-05-09 13:02:43 +03:00
parent 30fea6d9d6
commit b2947f2164
6 changed files with 17 additions and 16 deletions

View file

@ -279,7 +279,6 @@ Keybinding | Description
<kbd>F12</kbd> | Toggle the Emacs menu bar.
<kbd>C-x g</kbd> | Open Magit's status buffer.
<kbd>M-Z</kbd> | Zap up to char.
<kbd>C-c J</kbd> or <kbd>Super-></kbd> | Switch between buffers with [`ace-jump-buffer`](https://github.com/waymondo/ace-jump-buffer)
<kbd>C-=</kbd> | Run `expand-region` (incremental text selection).
<kbd>C-a</kbd> | Run `prelude-move-beginning-of-line`. Read [this](http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/) for details.
@ -429,9 +428,9 @@ buffer. Passing prefix argument **BEFORE** =helm-M-x= **has no effect**.
Keybinding | Description
-------------------|----------------------------------------------
<kbd>jj</kbd> | Jump to the beginning of a word(`ace-jump-word-mode`)
<kbd>jk</kbd> | Jump to a character(`ace-jump-char-mode`)
<kbd>jl</kbd> | Jump to the beginning of a line(`ace-jump-line-mode`)
<kbd>jj</kbd> | Jump to the beginning of a word(`avy-goto-word-1`)
<kbd>jk</kbd> | Jump to a character(`avy-goto-char`)
<kbd>jl</kbd> | Jump to the beginning of a line(`avy-goto-line`)
<kbd>JJ</kbd> | Jump back to previous buffer(`prelude-switch-to-previous-buffer`)
<kbd>uu</kbd> | View edits as a tree(`undo-tree-visualize`)
<kbd>xx</kbd> | Executed extended command(`execute-extended-command`)

View file

@ -259,6 +259,12 @@ The body of the advice is in BODY."
(setq projectile-cache-file (expand-file-name "projectile.cache" prelude-savefile-dir))
(projectile-global-mode t)
;; avy allows us to effectively navigate to visible things
(require 'avy-jump)
(setq avy-background t)
(setq avy-goto-char-style 'at)
(setq avy-goto-word-style 'at)
;; anzu-mode enhances isearch & query-replace by showing total matches and current match position
(require 'anzu)
(diminish 'anzu-mode)

View file

@ -112,10 +112,8 @@
(global-set-key (kbd "C-=") 'er/expand-region)
(global-set-key (kbd "C-c j") 'ace-jump-mode)
(global-set-key (kbd "s-.") 'ace-jump-mode)
(global-set-key (kbd "C-c J") 'ace-jump-buffer)
(global-set-key (kbd "s->") 'ace-jump-buffer)
(global-set-key (kbd "C-c j") 'avy-goto-word-1)
(global-set-key (kbd "s-.") 'avy-goto-word-1)
(global-set-key (kbd "s-w") 'ace-window)
(provide 'prelude-global-keybindings)

View file

@ -42,9 +42,7 @@
(package-initialize)
(defvar prelude-packages
'(ace-jump-mode
ace-jump-buffer
ace-window
'(avy
anzu
browse-kill-ring
dash

View file

@ -122,8 +122,8 @@
(setq evil-shift-width 2)
;;; enable ace-jump mode with evil-mode
(define-key evil-normal-state-map (kbd "SPC") 'ace-jump-mode)
;;; enable avy with evil-mode
(define-key evil-normal-state-map (kbd "SPC") 'avy-goto-word-1)
;;; snagged from Eric S. Fraga
;;; http://lists.gnu.org/archive/html/emacs-orgmode/2012-05/msg00153.html

View file

@ -35,9 +35,9 @@
(require 'key-chord)
(key-chord-define-global "jj" 'ace-jump-word-mode)
(key-chord-define-global "jl" 'ace-jump-line-mode)
(key-chord-define-global "jk" 'ace-jump-char-mode)
(key-chord-define-global "jj" 'avy-goto-word-1)
(key-chord-define-global "jl" 'avy-goto-line)
(key-chord-define-global "jk" 'avy-goto-char)
(key-chord-define-global "JJ" 'prelude-switch-to-previous-buffer)
(key-chord-define-global "uu" 'undo-tree-visualize)
(key-chord-define-global "xx" 'execute-extended-command)