Skip to content

Commit 47a8eff

Browse files
committed
emacs: replace ace-jump-mode with ace-window
1 parent beb6181 commit 47a8eff

3 files changed

Lines changed: 142 additions & 84 deletions

File tree

emacs/init.el

Lines changed: 70 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -606,17 +606,6 @@
606606
("k" . 2048-up)
607607
("l" . 2048-right)))
608608

609-
;; ace-jump-mode
610-
611-
;; [[./img/ace_jump.png]]
612-
613-
;; [[https://github.com/winterTTr/ace-jump-mode][Ace jump mode]] is a minor mode of emacs, which help you to move the cursor within
614-
;; Emacs
615-
616-
(use-package ace-jump-mode
617-
:defer 5
618-
:ensure t)
619-
620609
;; ace-link
621610

622611
;; [[./img/ace_link.png]]
@@ -630,11 +619,35 @@
630619
;; |---------+------------+--------------|
631620

632621
(use-package ace-link
633-
:ensure t
622+
:ensure ace-jump-mode
634623
:defer 3
635624
:config
636625
(ace-link-setup-default))
637626

627+
;; ace-window
628+
629+
;; [[./img/ace_window.png]]
630+
631+
;; [[https://github.com/abo-abo/ace-window][ace-window]] is package for selecting a window to switch to. Also can be used to
632+
;; jump to words, lines, chars, subwords, move/delete/copy lines and other some
633+
;; nice features.
634+
635+
(use-package ace-window
636+
:ensure t
637+
:defer 1
638+
: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)
643+
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")))))
649+
(ace-window-display-mode t))
650+
638651
;; ag
639652

640653
;; [[./img/ag.png]]
@@ -1724,21 +1737,22 @@
17241737
╭─────────┐
17251738
Move to Window Switch Do │ Buffers │
17261739
╭────────────────────────────────────────────────────────────────────┴─────────╯
1727-
^_k_^ [_b_] switch (ido) [_d_] kill the buffer
1728-
^^↑^^ [_i_] ibuffer [_r_] toggle read-only mode
1729-
_h_ ← → _l_ [_a_] alternate [_u_] revert buffer changes
1730-
^^↓^^ [_s_] switch (helm) [_w_] save buffer
1731-
^_j_^
1740+
^ ^ _k_ ^ ^ [_b_] switch (ido) [_d_] kill the buffer
1741+
^ ^ ^ ↑ ^ ^ ^ [_i_] ibuffer [_r_] toggle read-only mode
1742+
_h_ ← _m_ → _l_ [_a_] alternate [_u_] revert buffer changes
1743+
^ ^ ^ ↓ ^ ^ ^ [_s_] switch (helm) [_w_] save buffer
1744+
^ ^ _j_ ^ ^
17321745
--------------------------------------------------------------------------------
17331746
"
17341747
("a" joe-alternate-buffers)
17351748
("b" ido-switch-buffer)
17361749
("d" joe-kill-this-buffer)
17371750
("i" ibuffer)
1738-
("h" buf-move-left :color red)
1739-
("k" buf-move-up :color red)
1740-
("j" buf-move-down :color red)
1741-
("l" buf-move-right :color red)
1751+
("m" ace-swap-window)
1752+
("h" buf-move-lef)
1753+
("k" buf-move-u)
1754+
("j" buf-move-dow)
1755+
("l" buf-move-righ)
17421756
("r" read-only-mode)
17431757
("s" helm-buffers-list)
17441758
("u" joe-revert-buffer)
@@ -1922,16 +1936,29 @@
19221936
(defhydra hydra-jump (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
19231937
"
19241938
╭──────┐
1925-
AceJump │ Jump │
1939+
Window Word/Char Line iSearch │ Jump │
19261940
╭───────────────────────────────────────────────────────────────────────┴──────╯
1927-
[_w_] acejump word mode
1928-
[_c_] acejump char mode
1929-
[_l_] acejump line mode
1941+
[_w_] jump [_j_] word [_l_] jump [_i_] jump
1942+
[_d_] close [_p_] all words [_y_] copy
1943+
[_z_] maximize [_b_] subword [_m_] move
1944+
[_s_] swap [_c_] char [_v_] copy region
1945+
^ ^ [_a_] two chars
19301946
--------------------------------------------------------------------------------
19311947
"
1932-
("w" evil-ace-jump-word-mode)
1933-
("c" evil-ace-jump-char-mode)
1934-
("l" evil-ace-jump-line-mode))
1948+
("w" ace-window)
1949+
("d" ace-delete-window)
1950+
("z" ace-maximize-window)
1951+
("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))
19351962

19361963
(defhydra hydra-spell (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
19371964
"
@@ -2128,31 +2155,31 @@
21282155
^_k_^ ^_K_^ ^_p_^ ╭─┬─┐^ ^ ╭─┬─┐^ ^ ↺ [_u_] undo layout
21292156
^^↑^^ ^^↑^^ ^^↑^^ │ │ │_v_ertical ├─┼─┤_b_alance ↻ [_r_] restore layout
21302157
_h_ ← → _l_ _H_ ← → _L_ ^^ ^^ ╰─┴─╯^ ^ ╰─┴─╯^ ^ ✗ [_d_] close window
2131-
^^↓^^ ^^↓^^ ^^↓^^ ╭───┐^ ^ ╭───┐^ ^ ⇋ [_w_] cycle window
2158+
^^↓^^ ^^↓^^ ^^↓^^ ╭───┐^ ^ ╭───┐^ ^ ⇋ [_w_] jump window
21322159
^_j_^ ^_J_^ ^_n_^ ├───┤_s_tack │ │_z_oom ⇱ [_f_] new frame
21332160
^^ ^^ ^^ ^^ ^^ ^^ ╰───╯^ ^ ╰───╯^ ^ ⇲ [_x_] delete frame
21342161
--------------------------------------------------------------------------------
21352162
"
21362163
("n" joe-scroll-other-window :color red)
21372164
("p" joe-scroll-other-window-down :color red)
21382165
("b" balance-windows)
2139-
("d" delete-window)
2166+
("d" ace-delete-window)
21402167
("f" make-frame)
21412168
("H" shrink-window-horizontally :color red)
2142-
("h" windmove-left :color red)
2169+
("h" windmove-left)
21432170
("J" shrink-window :color red)
2144-
("j" windmove-down :color red)
2171+
("j" windmove-down)
21452172
("K" enlarge-window :color red)
2146-
("k" windmove-up :color red)
2173+
("k" windmove-up)
21472174
("L" enlarge-window-horizontally :color red)
2148-
("l" windmove-right :color red)
2175+
("l" windmove-righ)
21492176
("r" winner-redo :color red)
2150-
("s" split-window-vertically :color red)
2177+
("s" split-window-vertically)
21512178
("u" winner-undo :color red)
2152-
("v" split-window-horizontally :color red)
2153-
("w" other-window)
2179+
("v" split-window-horizontally)
2180+
("w" ace-window)
21542181
("x" delete-frame)
2155-
("z" delete-other-windows))
2182+
("z" ace-maximize-window))
21562183

21572184
(defhydra hydra-system (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
21582185
"
@@ -2237,9 +2264,10 @@
22372264
[_c_] comment [_a_] align with regex
22382265
[_f_] fill column [_p_] show character code
22392266
[_h_] hidden chars [_i_] insert unicode character (helm)
2240-
[_t_] trailing whitespace [_w_] remove trailing whitespaces
2267+
[_t_] trailing whitespace [_s_] remove trailing whitespaces
22412268
[_v_] font space [_u_] undo tree
22422269
^ ^ [_j_] jump word
2270+
^ ^ [_w_] jump window
22432271
^ ^ [_x_] comment box
22442272
^ ^ [_r_] expand region
22452273
^ ^ [_m_] iedit (multiple edit)
@@ -2254,14 +2282,15 @@
22542282
("g" google-translate-smooth-translate)
22552283
("h" whitespace-mode)
22562284
("i" helm-ucs)
2257-
("j" evil-ace-jump-word-mode)
2285+
("j" avi-goto-word-1)
2286+
("w" ace-window)
22582287
("m" iedit-mode)
22592288
("n" count-words)
22602289
("p" describe-char)
22612290
("t" joe-toggle-show-trailing-whitespace)
22622291
("u" undo-tree-visualize)
22632292
("v" variable-pitch-mode)
2264-
("w" whitespace-cleanup)
2293+
("s" whitespace-cleanup)
22652294
("x" comment-box)))
22662295

22672296
;; ibuffer-vc

emacs/readme.org

Lines changed: 72 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -716,19 +716,6 @@ your time. Also is a simple and enjoying game.
716716
("l" . 2048-right)))
717717
#+END_SRC
718718

719-
** ace-jump-mode
720-
721-
[[./img/ace_jump.png]]
722-
723-
[[https://github.com/winterTTr/ace-jump-mode][Ace jump mode]] is a minor mode of emacs, which help you to move the cursor within
724-
Emacs
725-
726-
#+BEGIN_SRC emacs-lisp
727-
(use-package ace-jump-mode
728-
:defer 5
729-
:ensure t)
730-
#+END_SRC
731-
732719
** ace-link
733720

734721
[[./img/ace_link.png]]
@@ -743,12 +730,38 @@ Works in org-mode, info, help and eww.
743730

744731
#+BEGIN_SRC emacs-lisp
745732
(use-package ace-link
746-
:ensure t
733+
:ensure ace-jump-mode
747734
:defer 3
748735
:config
749736
(ace-link-setup-default))
750737
#+END_SRC
751738

739+
** ace-window
740+
741+
[[./img/ace_window.png]]
742+
743+
[[https://github.com/abo-abo/ace-window][ace-window]] is package for selecting a window to switch to. Also can be used to
744+
jump to words, lines, chars, subwords, move/delete/copy lines and other some
745+
nice features.
746+
747+
#+BEGIN_SRC emacs-lisp
748+
(use-package ace-window
749+
:ensure t
750+
:defer 1
751+
:config
752+
(setq avi-keys '(?a ?s ?d ?e ?f ?g ?r ?v ?h ?j ?k ?l ?n ?m ?u)
753+
avi-background t
754+
avi-all-windows t
755+
aw-keys '(?a ?s ?d ?f ?j ?k ?l)
756+
aw-flip-keys '("w" "n"))
757+
;; FIXME: to change, for some reason failed with set-face-attribute, look later
758+
(custom-set-faces
759+
'(avi-lead-face ((t (:foreground "gold" :weight bold))))
760+
'(aw-leading-char-face ((t (:foreground "deep sky blue" :weight bold))))
761+
'(aw-mode-line-face ((t (:inherit mode-line-buffer-id :foreground "lawn green")))))
762+
(ace-window-display-mode t))
763+
#+END_SRC
764+
752765
** ag
753766

754767
[[./img/ag.png]]
@@ -2002,21 +2015,22 @@ that way.
20022015
╭─────────┐
20032016
Move to Window Switch Do │ Buffers │
20042017
╭────────────────────────────────────────────────────────────────────┴─────────╯
2005-
^_k_^ [_b_] switch (ido) [_d_] kill the buffer
2006-
^^↑^^ [_i_] ibuffer [_r_] toggle read-only mode
2007-
_h_ ← → _l_ [_a_] alternate [_u_] revert buffer changes
2008-
^^↓^^ [_s_] switch (helm) [_w_] save buffer
2009-
^_j_^
2018+
^ ^ _k_ ^ ^ [_b_] switch (ido) [_d_] kill the buffer
2019+
^ ^ ^ ↑ ^ ^ ^ [_i_] ibuffer [_r_] toggle read-only mode
2020+
_h_ ← _m_ → _l_ [_a_] alternate [_u_] revert buffer changes
2021+
^ ^ ^ ↓ ^ ^ ^ [_s_] switch (helm) [_w_] save buffer
2022+
^ ^ _j_ ^ ^
20102023
--------------------------------------------------------------------------------
20112024
"
20122025
("a" joe-alternate-buffers)
20132026
("b" ido-switch-buffer)
20142027
("d" joe-kill-this-buffer)
20152028
("i" ibuffer)
2016-
("h" buf-move-left :color red)
2017-
("k" buf-move-up :color red)
2018-
("j" buf-move-down :color red)
2019-
("l" buf-move-right :color red)
2029+
("m" ace-swap-window)
2030+
("h" buf-move-lef)
2031+
("k" buf-move-u)
2032+
("j" buf-move-dow)
2033+
("l" buf-move-righ)
20202034
("r" read-only-mode)
20212035
("s" helm-buffers-list)
20222036
("u" joe-revert-buffer)
@@ -2200,16 +2214,29 @@ that way.
22002214
(defhydra hydra-jump (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
22012215
"
22022216
╭──────┐
2203-
AceJump │ Jump │
2217+
Window Word/Char Line iSearch │ Jump │
22042218
╭───────────────────────────────────────────────────────────────────────┴──────╯
2205-
[_w_] acejump word mode
2206-
[_c_] acejump char mode
2207-
[_l_] acejump line mode
2219+
[_w_] jump [_j_] word [_l_] jump [_i_] jump
2220+
[_d_] close [_p_] all words [_y_] copy
2221+
[_z_] maximize [_b_] subword [_m_] move
2222+
[_s_] swap [_c_] char [_v_] copy region
2223+
^ ^ [_a_] two chars
22082224
--------------------------------------------------------------------------------
22092225
"
2210-
("w" evil-ace-jump-word-mode)
2211-
("c" evil-ace-jump-char-mode)
2212-
("l" evil-ace-jump-line-mode))
2226+
("w" ace-window)
2227+
("d" ace-delete-window)
2228+
("z" ace-maximize-window)
2229+
("s" ace-swap-window)
2230+
("j" avi-goto-word-1)
2231+
("p" avi-goto-word-0)
2232+
("b" avi-goto-subword-0)
2233+
("c" avi-goto-char)
2234+
("a" avi-goto-char-2)
2235+
("l" avi-goto-line)
2236+
("y" avi-copy-line)
2237+
("m" avi-move-line)
2238+
("v" avi-copy-region)
2239+
("i" avi-isearch))
22132240

22142241
(defhydra hydra-spell (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
22152242
"
@@ -2406,31 +2433,31 @@ that way.
24062433
^_k_^ ^_K_^ ^_p_^ ╭─┬─┐^ ^ ╭─┬─┐^ ^ ↺ [_u_] undo layout
24072434
^^↑^^ ^^↑^^ ^^↑^^ │ │ │_v_ertical ├─┼─┤_b_alance ↻ [_r_] restore layout
24082435
_h_ ← → _l_ _H_ ← → _L_ ^^ ^^ ╰─┴─╯^ ^ ╰─┴─╯^ ^ ✗ [_d_] close window
2409-
^^↓^^ ^^↓^^ ^^↓^^ ╭───┐^ ^ ╭───┐^ ^ ⇋ [_w_] cycle window
2436+
^^↓^^ ^^↓^^ ^^↓^^ ╭───┐^ ^ ╭───┐^ ^ ⇋ [_w_] jump window
24102437
^_j_^ ^_J_^ ^_n_^ ├───┤_s_tack │ │_z_oom ⇱ [_f_] new frame
24112438
^^ ^^ ^^ ^^ ^^ ^^ ╰───╯^ ^ ╰───╯^ ^ ⇲ [_x_] delete frame
24122439
--------------------------------------------------------------------------------
24132440
"
24142441
("n" joe-scroll-other-window :color red)
24152442
("p" joe-scroll-other-window-down :color red)
24162443
("b" balance-windows)
2417-
("d" delete-window)
2444+
("d" ace-delete-window)
24182445
("f" make-frame)
24192446
("H" shrink-window-horizontally :color red)
2420-
("h" windmove-left :color red)
2447+
("h" windmove-left)
24212448
("J" shrink-window :color red)
2422-
("j" windmove-down :color red)
2449+
("j" windmove-down)
24232450
("K" enlarge-window :color red)
2424-
("k" windmove-up :color red)
2451+
("k" windmove-up)
24252452
("L" enlarge-window-horizontally :color red)
2426-
("l" windmove-right :color red)
2453+
("l" windmove-righ)
24272454
("r" winner-redo :color red)
2428-
("s" split-window-vertically :color red)
2455+
("s" split-window-vertically)
24292456
("u" winner-undo :color red)
2430-
("v" split-window-horizontally :color red)
2431-
("w" other-window)
2457+
("v" split-window-horizontally)
2458+
("w" ace-window)
24322459
("x" delete-frame)
2433-
("z" delete-other-windows))
2460+
("z" ace-maximize-window))
24342461

24352462
(defhydra hydra-system (:color blue :hint nil :idle 0.4 :inherit (hydra-common/heads))
24362463
"
@@ -2515,9 +2542,10 @@ that way.
25152542
[_c_] comment [_a_] align with regex
25162543
[_f_] fill column [_p_] show character code
25172544
[_h_] hidden chars [_i_] insert unicode character (helm)
2518-
[_t_] trailing whitespace [_w_] remove trailing whitespaces
2545+
[_t_] trailing whitespace [_s_] remove trailing whitespaces
25192546
[_v_] font space [_u_] undo tree
25202547
^ ^ [_j_] jump word
2548+
^ ^ [_w_] jump window
25212549
^ ^ [_x_] comment box
25222550
^ ^ [_r_] expand region
25232551
^ ^ [_m_] iedit (multiple edit)
@@ -2532,14 +2560,15 @@ that way.
25322560
("g" google-translate-smooth-translate)
25332561
("h" whitespace-mode)
25342562
("i" helm-ucs)
2535-
("j" evil-ace-jump-word-mode)
2563+
("j" avi-goto-word-1)
2564+
("w" ace-window)
25362565
("m" iedit-mode)
25372566
("n" count-words)
25382567
("p" describe-char)
25392568
("t" joe-toggle-show-trailing-whitespace)
25402569
("u" undo-tree-visualize)
25412570
("v" variable-pitch-mode)
2542-
("w" whitespace-cleanup)
2571+
("s" whitespace-cleanup)
25432572
("x" comment-box)))
25442573
#+END_SRC
25452574

0 commit comments

Comments
 (0)