(Emacs)~ivy config uses :init

This commit is contained in:
2023-09-29 21:20:06 +01:00
parent 7c09c2c22c
commit cad10ea64f

View File

@@ -686,7 +686,7 @@ selection list).
"C-j" #'ivy-yank-symbol "C-j" #'ivy-yank-symbol
"M-j" #'ivy-next-line-or-history "M-j" #'ivy-next-line-or-history
"M-k" #'ivy-previous-line-or-history "M-k" #'ivy-previous-line-or-history
"C-c C-e" #'ivy-occur) "C-SPC" #'ivy-occur)
(general-def (general-def
:keymaps 'ivy-switch-buffer-map :keymaps 'ivy-switch-buffer-map
"M-j" #'ivy-next-line-or-history "M-j" #'ivy-next-line-or-history
@@ -701,8 +701,13 @@ selection list).
"W" #'ivy-wgrep-change-to-wgrep-mode "W" #'ivy-wgrep-change-to-wgrep-mode
"{" #'compilation-previous-file "{" #'compilation-previous-file
"}" #'compilation-next-file) "}" #'compilation-next-file)
:config :init
(require 'counsel nil t) (with-eval-after-load "evil"
(evil-set-initial-state 'ivy-occur-mode 'normal)
(evil-set-initial-state 'ivy-occur-grep-mode 'normal))
(with-eval-after-load "amx"
(setq amx-backend 'ivy))
(setq ivy-height 10 (setq ivy-height 10
ivy-wrap t ivy-wrap t
ivy-fixed-height-minibuffer t ivy-fixed-height-minibuffer t
@@ -710,17 +715,14 @@ selection list).
ivy-virtual-abbreviate 'full ivy-virtual-abbreviate 'full
ivy-on-del-error-function #'ignore ivy-on-del-error-function #'ignore
ivy-use-selectable-prompt t) ivy-use-selectable-prompt t)
(with-eval-after-load "amx" :config
(setq amx-backend 'ivy)) (require 'counsel nil t))
(with-eval-after-load "evil"
(evil-set-initial-state 'ivy-occur-mode 'normal)
(evil-set-initial-state 'ivy-occur-grep-mode 'normal)))
#+end_src #+end_src
**** Counsel **** Counsel
Setup for counsel. Load after ivy and helpful. Setup for counsel. Load after ivy and helpful.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package counsel (use-package counsel
:after ivy :defer t
:general :general
(search-leader (search-leader
"s" #'counsel-grep-or-swiper "s" #'counsel-grep-or-swiper