Skip to content

Commit 46c246b

Browse files
committed
emacs: update due the changes in avy, ace-window and ace-link
1 parent 53dbed1 commit 46c246b

3 files changed

Lines changed: 96 additions & 70 deletions

File tree

emacs/init.el

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -619,33 +619,26 @@
619619
;; |---------+------------+--------------|
620620

621621
(use-package ace-link
622-
:ensure ace-jump-mode
622+
:ensure t
623+
:ensure avy
623624
:defer 3
624625
:config
625626
(ace-link-setup-default))
626627

627628
;; ace-window
628629

629-
;; [[./img/ace_window.png]]
630-
631630
;; [[https://github.com/abo-abo/ace-window][ace-window]] is a package for selecting a window to switch to. Also can be used to
632631
;; jump to words, lines, chars, subwords, move/delete/copy lines and other some
633632
;; nice features.
634633

635634
(use-package ace-window
636635
:ensure t
637-
:defer 1
636+
:ensure avy
638637
:config
639-
(setq avi-keys '(?a ?s ?d ?e ?f ?g ?r ?v ?h ?j ?k ?l ?n ?m ?u)
640-
avi-background t
641-
avi-all-windows t
642-
aw-keys '(?a ?s ?d ?f ?j ?k ?l)
638+
(set-face-attribute 'aw-leading-char-face nil :foreground "deep sky blue" :weight 'bold)
639+
(set-face-attribute 'aw-mode-line-face nil :inherit 'mode-line-buffer-id :foreground "lawn green")
640+
(setq aw-keys '(?a ?s ?d ?f ?j ?k ?l)
643641
aw-flip-keys '("w" "n"))
644-
;; FIXME: to change, for some reason failed with set-face-attribute, look later
645-
(custom-set-faces
646-
'(avi-lead-face ((t (:foreground "gold" :weight bold))))
647-
'(aw-leading-char-face ((t (:foreground "deep sky blue" :weight bold))))
648-
'(aw-mode-line-face ((t (:inherit mode-line-buffer-id :foreground "lawn green")))))
649642
(ace-window-display-mode t))
650643

651644
;; ag
@@ -711,6 +704,23 @@
711704
))
712705
(real-global-auto-complete-mode t))
713706

707+
;; avy
708+
709+
;; [[./img/avy.png]]
710+
711+
;; [[https://github.com/abo-abo/avy][avy]] is a GNU Emacs package for jumping to visible text using a char-based
712+
;; decision tree.
713+
714+
(use-package avy
715+
:ensure t
716+
:config
717+
(setq avy-keys '(?a ?s ?d ?e ?f ?g ?r ?v ?h ?j ?k ?l ?n ?m ?u)
718+
avy-background t
719+
avy-all-windows t)
720+
(use-package avy-jump
721+
:config
722+
(set-face-attribute 'avy-lead-face nil :foreground "gold" :weight 'bold :background nil)))
723+
714724
;; boxquote
715725

716726
;; [[./img/boxquote.png]]
@@ -1142,6 +1152,7 @@
11421152
text-mode
11431153
prog-mode
11441154
term-mode
1155+
conf-mode
11451156
twittering-edit-mode)
11461157
"List of modes that should start up in Evil state."
11471158
:type '(symbol))
@@ -1262,6 +1273,7 @@
12621273
(setq evilnc-hotkey-comment-operator ""))
12631274

12641275
(use-package evil-iedit-state
1276+
:ensure t
12651277
:ensure expand-region
12661278
:config
12671279
(add-hook 'iedit-mode-hook 'evil-iedit-state)
@@ -1387,7 +1399,7 @@
13871399
(add-hook 'sgml-mode 'flycheck-mode)
13881400
(use-package helm-flycheck
13891401
:ensure t
1390-
:requires helm
1402+
:ensure helm
13911403
:commands helm-flycheck))
13921404

13931405
;; git-modes
@@ -1752,7 +1764,7 @@
17521764
("h" buf-move-lef)
17531765
("k" buf-move-u)
17541766
("j" buf-move-dow)
1755-
("l" buf-move-righ)
1767+
("l" buf-move-right)
17561768
("r" read-only-mode)
17571769
("s" helm-buffers-list)
17581770
("u" joe-revert-buffer)
@@ -1949,16 +1961,16 @@
19491961
("d" ace-delete-window)
19501962
("z" ace-maximize-window)
19511963
("s" ace-swap-window)
1952-
("j" avi-goto-word-1)
1953-
("p" avi-goto-word-0)
1954-
("b" avi-goto-subword-0)
1955-
("c" avi-goto-char)
1956-
("a" avi-goto-char-2)
1957-
("l" avi-goto-line)
1958-
("y" avi-copy-line)
1959-
("m" avi-move-line)
1960-
("v" avi-copy-region)
1961-
("i" avi-isearch))
1964+
("j" avy-goto-word-1)
1965+
("p" avy-goto-word-0)
1966+
("b" avy-goto-subword-0)
1967+
("c" avy-goto-char)
1968+
("a" avy-goto-char-2)
1969+
("l" avy-goto-line)
1970+
("y" avy-copy-line)
1971+
("m" avy-move-line)
1972+
("v" avy-copy-region)
1973+
("i" avy-isearch))
19621974

19631975
(defhydra hydra-spell (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
19641976
"
@@ -2172,7 +2184,7 @@
21722184
("K" enlarge-window :color red)
21732185
("k" windmove-up)
21742186
("L" enlarge-window-horizontally :color red)
2175-
("l" windmove-righ)
2187+
("l" windmove-right)
21762188
("r" winner-redo :color red)
21772189
("s" split-window-vertically)
21782190
("u" winner-undo :color red)
@@ -2283,7 +2295,7 @@
22832295
("g" google-translate-smooth-translate)
22842296
("h" whitespace-mode)
22852297
("i" helm-ucs)
2286-
("j" avi-goto-word-1)
2298+
("j" avy-goto-word-1)
22872299
("w" ace-window)
22882300
("m" iedit-mode)
22892301
("n" count-words)
@@ -2333,7 +2345,7 @@
23332345
(use-package ido-ubiquitous
23342346
:ensure t
23352347
:disabled t
2336-
:requires ido
2348+
:ensure ido
23372349
:config
23382350
(ido-ubiquitous-mode t)
23392351
(setq ido-ubiquitous-max-items 50000))
@@ -2344,7 +2356,7 @@
23442356

23452357
(use-package ido-vertical-mode
23462358
:ensure t
2347-
:requires ido
2359+
:ensure ido
23482360
:config
23492361
(ido-vertical-mode t))
23502362

@@ -3485,7 +3497,7 @@
34853497
("<escape>" . minibuffer-keyboard-quit))
34863498
(bind-keys :map ivy-minibuffer-map
34873499
("<escape>" . minibuffer-keyboard-quit)
3488-
("C-k" . delete-minibuffer-contents))
3500+
("C-k" . delete-minibuffer-contents))
34893501
(ivy-mode t))
34903502

34913503
;; twittering-mode
@@ -3822,12 +3834,12 @@
38223834

38233835
(use-package helm-emmet
38243836
:ensure t
3825-
:requires helm
3837+
:ensure helm
38263838
:commands helm-emmet)
38273839

38283840
(use-package ac-emmet
38293841
:ensure t
3830-
:requires auto-complete
3842+
:ensure auto-complete
38313843
:config
38323844
(add-hook 'sgml-mode-hook 'ac-emmet-html-setup)
38333845
(add-hook 'css-mode-hook 'ac-emmet-css-setup)))

emacs/readme.org

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ Settings for the Emacs Web Browser.
692692

693693
(setq org-confirm-babel-evaluate 'joe-org-confirm-babel-evaluate)))
694694
#+END_SRC
695-
695+
696696
* TODO Packages [0/18]
697697

698698
What I try here is to config each package as atomic as possible, so to ensure
@@ -731,36 +731,29 @@ Works in org-mode, info, help and eww.
731731

732732
#+BEGIN_SRC emacs-lisp
733733
(use-package ace-link
734-
:ensure ace-jump-mode
734+
:ensure t
735+
:ensure avy
735736
:defer 3
736737
:config
737738
(ace-link-setup-default))
738739
#+END_SRC
739740

740741
** ace-window
741742

742-
[[./img/ace_window.png]]
743-
744743
[[https://github.com/abo-abo/ace-window][ace-window]] is a package for selecting a window to switch to. Also can be used to
745744
jump to words, lines, chars, subwords, move/delete/copy lines and other some
746745
nice features.
747746

748747
#+BEGIN_SRC emacs-lisp
749-
(use-package ace-window
750-
:ensure t
751-
:defer 1
752-
:config
753-
(setq avi-keys '(?a ?s ?d ?e ?f ?g ?r ?v ?h ?j ?k ?l ?n ?m ?u)
754-
avi-background t
755-
avi-all-windows t
756-
aw-keys '(?a ?s ?d ?f ?j ?k ?l)
757-
aw-flip-keys '("w" "n"))
758-
;; FIXME: to change, for some reason failed with set-face-attribute, look later
759-
(custom-set-faces
760-
'(avi-lead-face ((t (:foreground "gold" :weight bold))))
761-
'(aw-leading-char-face ((t (:foreground "deep sky blue" :weight bold))))
762-
'(aw-mode-line-face ((t (:inherit mode-line-buffer-id :foreground "lawn green")))))
763-
(ace-window-display-mode t))
748+
(use-package ace-window
749+
:ensure t
750+
:ensure avy
751+
:config
752+
(set-face-attribute 'aw-leading-char-face nil :foreground "deep sky blue" :weight 'bold)
753+
(set-face-attribute 'aw-mode-line-face nil :inherit 'mode-line-buffer-id :foreground "lawn green")
754+
(setq aw-keys '(?a ?s ?d ?f ?j ?k ?l)
755+
aw-flip-keys '("w" "n"))
756+
(ace-window-display-mode t))
764757
#+END_SRC
765758

766759
** ag
@@ -832,6 +825,25 @@ that automates and advances completion-system.
832825
(real-global-auto-complete-mode t))
833826
#+END_SRC
834827

828+
** avy
829+
830+
[[./img/avy.png]]
831+
832+
[[https://github.com/abo-abo/avy][avy]] is a GNU Emacs package for jumping to visible text using a char-based
833+
decision tree.
834+
835+
#+BEGIN_SRC emacs-lisp
836+
(use-package avy
837+
:ensure t
838+
:config
839+
(setq avy-keys '(?a ?s ?d ?e ?f ?g ?r ?v ?h ?j ?k ?l ?n ?m ?u)
840+
avy-background t
841+
avy-all-windows t)
842+
(use-package avy-jump
843+
:config
844+
(set-face-attribute 'avy-lead-face nil :foreground "gold" :weight 'bold :background nil)))
845+
#+END_SRC
846+
835847
** boxquote
836848

837849
[[./img/boxquote.png]]
@@ -1220,12 +1232,12 @@ produces this HTML:
12201232

12211233
(use-package helm-emmet
12221234
:ensure t
1223-
:requires helm
1235+
:ensure helm
12241236
:commands helm-emmet)
12251237

12261238
(use-package ac-emmet
12271239
:ensure t
1228-
:requires auto-complete
1240+
:ensure auto-complete
12291241
:config
12301242
(add-hook 'sgml-mode-hook 'ac-emmet-html-setup)
12311243
(add-hook 'css-mode-hook 'ac-emmet-css-setup)))
@@ -1394,6 +1406,7 @@ pressing the key until it selects what you want.
13941406
text-mode
13951407
prog-mode
13961408
term-mode
1409+
conf-mode
13971410
twittering-edit-mode)
13981411
"List of modes that should start up in Evil state."
13991412
:type '(symbol))
@@ -1514,6 +1527,7 @@ pressing the key until it selects what you want.
15141527
(setq evilnc-hotkey-comment-operator ""))
15151528

15161529
(use-package evil-iedit-state
1530+
:ensure t
15171531
:ensure expand-region
15181532
:config
15191533
(add-hook 'iedit-mode-hook 'evil-iedit-state)
@@ -1647,7 +1661,7 @@ Text developed by Pixel Lab.
16471661
(add-hook 'sgml-mode 'flycheck-mode)
16481662
(use-package helm-flycheck
16491663
:ensure t
1650-
:requires helm
1664+
:ensure helm
16511665
:commands helm-flycheck))
16521666
#+END_SRC
16531667

@@ -2031,7 +2045,7 @@ that way.
20312045
("h" buf-move-lef)
20322046
("k" buf-move-u)
20332047
("j" buf-move-dow)
2034-
("l" buf-move-righ)
2048+
("l" buf-move-right)
20352049
("r" read-only-mode)
20362050
("s" helm-buffers-list)
20372051
("u" joe-revert-buffer)
@@ -2228,16 +2242,16 @@ that way.
22282242
("d" ace-delete-window)
22292243
("z" ace-maximize-window)
22302244
("s" ace-swap-window)
2231-
("j" avi-goto-word-1)
2232-
("p" avi-goto-word-0)
2233-
("b" avi-goto-subword-0)
2234-
("c" avi-goto-char)
2235-
("a" avi-goto-char-2)
2236-
("l" avi-goto-line)
2237-
("y" avi-copy-line)
2238-
("m" avi-move-line)
2239-
("v" avi-copy-region)
2240-
("i" avi-isearch))
2245+
("j" avy-goto-word-1)
2246+
("p" avy-goto-word-0)
2247+
("b" avy-goto-subword-0)
2248+
("c" avy-goto-char)
2249+
("a" avy-goto-char-2)
2250+
("l" avy-goto-line)
2251+
("y" avy-copy-line)
2252+
("m" avy-move-line)
2253+
("v" avy-copy-region)
2254+
("i" avy-isearch))
22412255

22422256
(defhydra hydra-spell (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
22432257
"
@@ -2451,7 +2465,7 @@ that way.
24512465
("K" enlarge-window :color red)
24522466
("k" windmove-up)
24532467
("L" enlarge-window-horizontally :color red)
2454-
("l" windmove-righ)
2468+
("l" windmove-right)
24552469
("r" winner-redo :color red)
24562470
("s" split-window-vertically)
24572471
("u" winner-undo :color red)
@@ -2562,7 +2576,7 @@ that way.
25622576
("g" google-translate-smooth-translate)
25632577
("h" whitespace-mode)
25642578
("i" helm-ucs)
2565-
("j" avi-goto-word-1)
2579+
("j" avy-goto-word-1)
25662580
("w" ace-window)
25672581
("m" iedit-mode)
25682582
("n" count-words)
@@ -2616,7 +2630,7 @@ to do so without breaking things.
26162630
(use-package ido-ubiquitous
26172631
:ensure t
26182632
:disabled t
2619-
:requires ido
2633+
:ensure ido
26202634
:config
26212635
(ido-ubiquitous-mode t)
26222636
(setq ido-ubiquitous-max-items 50000))
@@ -2629,7 +2643,7 @@ to do so without breaking things.
26292643
#+BEGIN_SRC emacs-lisp
26302644
(use-package ido-vertical-mode
26312645
:ensure t
2632-
:requires ido
2646+
:ensure ido
26332647
:config
26342648
(ido-vertical-mode t))
26352649
#+END_SRC
@@ -4538,7 +4552,7 @@ regex.
45384552
("<escape>" . minibuffer-keyboard-quit))
45394553
(bind-keys :map ivy-minibuffer-map
45404554
("<escape>" . minibuffer-keyboard-quit)
4541-
("C-k" . delete-minibuffer-contents))
4555+
("C-k" . delete-minibuffer-contents))
45424556
(ivy-mode t))
45434557
#+END_SRC
45444558

0 commit comments

Comments
 (0)