[Emacs] Better iedit configuration

This commit is contained in:
Lucien Cartier-Tilet 2022-09-19 12:37:57 +02:00
parent d378016e10
commit d68f406ae8
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -2987,31 +2987,34 @@ enough for me.
:END: :END:
Iedit is a powerful text editing tool that can be used to refactor Iedit is a powerful text editing tool that can be used to refactor
code through the edition of multiple regions at once, be it in a code through the edition of multiple regions at once, be it in a
region or in a whole buffer. region or in a whole buffer. Since Im using evil, Ill also use a
#+begin_src emacs-lisp compatibility package that adds states for iedit.
(use-package iedit
:defer t
:straight (:build t)
:general
(phundrak/leader-key
:infix "r"
:packages 'iedit
"" '(:ignore t :which-key "refactor")
"i" #'iedit-mode))
#+end_src
Since Im using evil, Ill also use a compatibility package that adds
states for iedit.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil-iedit-state (use-package evil-iedit-state
:after iedit
:defer t :defer t
:straight (:build t) :straight (:build t)
:commands (evil-iedit-state evil-iedit-state/iedit-mode) :commands (evil-iedit-state evil-iedit-state/iedit-mode)
:init :init
(setq iedit-curent-symbol-default t (setq iedit-curent-symbol-default t
iedit-only-at-symbol-boundaries t iedit-only-at-symbol-boundaries t
iedit-toggle-key-default nil)) iedit-toggle-key-default nil)
:general
(phundrak/leader-key
:infix "r"
:packages '(iedit evil-iedit-state)
"" '(:ignore t :which-key "refactor")
"i" #'evil-iedit-state/iedit-mode)
(general-define-key
:keymaps 'evil-iedit-state-map
"c" nil
"s" nil
"J" nil
"S" #'iedit-expand-down-a-line
"T" #'iedit-expand-up-a-line
"h" #'evil-iedit-state/evil-change
"k" #'evil-iedit-state/evil-substitute
"K" #'evil-iedit-state/substitute
"q" #'evil-iedit-state/quit-iedit-mode))
#+end_src #+end_src
*** Parinfer *** Parinfer