Add ace-link package to spacemacs layer
This commit is contained in:
parent
a8efc6f86f
commit
77b0cc4ba6
|
@ -1205,6 +1205,15 @@ Key Binding | Description
|
||||||
|
|
||||||
Hint: you may change to char mode by `C-c C-c` in word mode.
|
Hint: you may change to char mode by `C-c C-c` in word mode.
|
||||||
|
|
||||||
|
#### ace-link mode
|
||||||
|
|
||||||
|
Similar to `ace-jump-mode`, [ace-link][ace-link] allows one to jump to any link in
|
||||||
|
`help-mode` and `info-mode` with two key strokes.
|
||||||
|
|
||||||
|
Key Binding | Description
|
||||||
|
---------------------|------------------------------------------------------------------
|
||||||
|
<kbd>o</kbd> | initiate ace link mode in `help-mode` and `info-mode`
|
||||||
|
|
||||||
### Window manipulation
|
### Window manipulation
|
||||||
|
|
||||||
#### Window manipulation key bindings
|
#### Window manipulation key bindings
|
||||||
|
@ -2445,6 +2454,7 @@ developers to elisp hackers!
|
||||||
[keychords]: http://www.emacswiki.org/emacs/KeyChord
|
[keychords]: http://www.emacswiki.org/emacs/KeyChord
|
||||||
[centered-cursor]: http://www.emacswiki.org/emacs/centered-cursor-mode.el
|
[centered-cursor]: http://www.emacswiki.org/emacs/centered-cursor-mode.el
|
||||||
[ace-jump]: https://github.com/winterTTr/ace-jump-mode
|
[ace-jump]: https://github.com/winterTTr/ace-jump-mode
|
||||||
|
[ace-link]: https://github.com/abo-abo/ace-link
|
||||||
[ace-window]: https://github.com/abo-abo/ace-window
|
[ace-window]: https://github.com/abo-abo/ace-window
|
||||||
[helm-link]: https://github.com/emacs-helm/helm
|
[helm-link]: https://github.com/emacs-helm/helm
|
||||||
[helm-doc]: https://github.com/emacs-helm/helm/wiki
|
[helm-doc]: https://github.com/emacs-helm/helm/wiki
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
(defvar spacemacs-packages
|
(defvar spacemacs-packages
|
||||||
'(
|
'(
|
||||||
ace-jump-mode
|
ace-jump-mode
|
||||||
|
ace-link
|
||||||
ace-window
|
ace-window
|
||||||
adaptive-wrap
|
adaptive-wrap
|
||||||
aggressive-indent
|
aggressive-indent
|
||||||
|
@ -136,6 +137,35 @@ which require an initialization must be listed explicitly in the list.")
|
||||||
(setq ace-jump-mode-scope 'global)
|
(setq ace-jump-mode-scope 'global)
|
||||||
(evil-leader/set-key "`" 'ace-jump-mode-pop-mark))))
|
(evil-leader/set-key "`" 'ace-jump-mode-pop-mark))))
|
||||||
|
|
||||||
|
(defun spacemacs/init-ace-link ()
|
||||||
|
(use-package ace-link
|
||||||
|
:defer t
|
||||||
|
:init (ace-link-setup-default)
|
||||||
|
:config
|
||||||
|
(progn
|
||||||
|
(defvar spacemacs--link-pattern "~?/.+\\|\s\\[")
|
||||||
|
|
||||||
|
(defun spacemacs//collect-spacemacs-buffer-links ()
|
||||||
|
(let ((end (window-end))
|
||||||
|
points)
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (window-start))
|
||||||
|
(while (re-search-forward spacemacs--link-pattern end t)
|
||||||
|
(push (+ (match-beginning 0) 1) points))
|
||||||
|
(nreverse points))))
|
||||||
|
|
||||||
|
(defun spacemacs//ace-buffer-links ()
|
||||||
|
"Ace jump to links in `spacemacs' buffer."
|
||||||
|
(interactive)
|
||||||
|
(ali-generic
|
||||||
|
(spacemacs//collect-spacemacs-buffer-links)
|
||||||
|
(forward-char 1)
|
||||||
|
(push-button)
|
||||||
|
))
|
||||||
|
|
||||||
|
(define-key spacemacs-mode-map "o" 'spacemacs//ace-buffer-links)
|
||||||
|
)))
|
||||||
|
|
||||||
(defun spacemacs/init-ace-window ()
|
(defun spacemacs/init-ace-window ()
|
||||||
(use-package ace-window
|
(use-package ace-window
|
||||||
:defer t
|
:defer t
|
||||||
|
|
Loading…
Reference in a new issue