From 54bb9f53792c3e1162d4c3e1d7d9f56eef6fb1a9 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Tue, 12 Apr 2022 16:11:22 +0200 Subject: [PATCH] Replace ace-jump-mode with avy --- config.el | 35 ++++++++++++++++++++++++++++++++--- packages.el | 2 -- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/config.el b/config.el index 1657a0c..0cd73fd 100644 --- a/config.el +++ b/config.el @@ -46,6 +46,25 @@ :inherit ,(remq 'hl-line (internal-get-lisp-face-attribute 'line-number-current-line :inherit)))) +(after! avy + (let ((avy-lead-face-fg (internal-get-lisp-face-attribute 'avy-lead-face + :background)) + (avy-lead-face-0-fg (internal-get-lisp-face-attribute 'avy-lead-face-0 + :background)) + (avy-lead-face-1-fg (internal-get-lisp-face-attribute 'avy-lead-face-1 + :background)) + (avy-lead-face-2-fg (internal-get-lisp-face-attribute 'avy-lead-face-2 + :background))) + (custom-theme-set-faces! 'doom-one + `(avy-lead-face :foreground ,avy-lead-face-fg + :background nil + :weight bold) + `(avy-lead-face-0 :foreground ,avy-lead-face-0-fg + :inherit avy-lead-face) + `(avy-lead-face-1 :foreground ,avy-lead-face-1-fg + :inherit avy-lead-face) + `(avy-lead-face-2 :foreground ,avy-lead-face-2-fg + :inherit avy-lead-face)))) ;; This determines the style of line numbers in effect. If set to `nil', line ;; numbers are disabled. For relative line numbers, set this to `relative'. @@ -92,6 +111,9 @@ ;; Override doom configuration. ;; ----------------------------------------------------------------------------- +;; Remove background from `avy'. +(after! avy (setq avy-background t)) + ;; Remove org-agenda from dashboard. (let ((org-agenda-section (seq-find (lambda (item) (string= (nth 0 item) "Open org-agenda")) @@ -208,9 +230,6 @@ ;; Configuration for additional packages on top of doom and its modules. ;; ----------------------------------------------------------------------------- -;; Faster navigation. -(use-package! ace-jump-mode - :bind (("C-c SPC" . ace-jump-mode))) ;; A nicer interface for ripgrep. Note that since doom required rg we don't ;; consider the case if it's not installed. @@ -294,6 +313,16 @@ "C-<" #'+x/scroll-down-one "C->" #'+x/scroll-up-one "M-Q" #'+x/unfill-paragraph + ;; Faster navigation with avy. + "M-g M-c" #'avy-goto-char + "M-g M-v" #'avy-goto-char-2 + "M-g M-l" #'avy-goto-line + "M-g M-e" #'avy-goto-word-0 + "M-g M-w" #'avy-goto-word-1 + "M-g M-t" #'avy-goto-char-timer + "M-g M-j" #'avy-resume + (:map isearch-mode-map + "C-'" #'avy-isearch) ;; Create binding before dired is loaded. "C-x C-j" #'dired-jump ;; More convenient window switching. diff --git a/packages.el b/packages.el index 74d87c4..79a0d57 100644 --- a/packages.el +++ b/packages.el @@ -8,8 +8,6 @@ ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: ;;(package! some-package) -(package! ace-jump-mode - :recipe (:local-repo "repos/ace-jump-mode")) (package! box-comment :recipe (:local-repo "repos/x-lib")) (package! deadgrep)