mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Minor updates.
This commit is contained in:
@@ -120,3 +120,12 @@ FLAGS can be g and/or i; which mean the same thing they do in
|
||||
:key #'evil-mc-get-cursor-start))
|
||||
(message "No cursors to undo in region"))
|
||||
(evil-mc-undo-last-added-cursor)))
|
||||
|
||||
|
||||
;;;###autoload (autoload '+multiple-cursors-execute-default-operator-fn "editor/multiple-cursors/autoload/evil-mc" nil t)
|
||||
|
||||
(after! evil-mc
|
||||
(evil-mc-define-handler +multiple-cursors-execute-default-operator-fn ()
|
||||
:cursor-clear region
|
||||
(evil-mc-with-region-or-execute-macro region t
|
||||
(funcall (evil-mc-get-command-name) region-start region-end))))
|
||||
|
||||
@@ -67,20 +67,22 @@
|
||||
(company-complete-common . evil-mc-execute-default-complete)
|
||||
(doom/backward-to-bol-or-indent . evil-mc-execute-default-call)
|
||||
(doom/forward-to-last-non-comment-or-eol . evil-mc-execute-default-call)
|
||||
;; :emacs undo
|
||||
(undo-fu-only-undo . evil-mc-execute-default-undo)
|
||||
(undo-fu-only-redo . evil-mc-execute-default-redo)
|
||||
;; :editor evil
|
||||
(evil-delete-back-to-indentation . evil-mc-execute-default-call)
|
||||
;; Have evil-mc work with explicit `evil-escape' (on C-g)
|
||||
(evil-escape . evil-mc-execute-default-evil-normal-state)
|
||||
;; Add `evil-org' support
|
||||
(evil-org-delete . evil-mc-execute-default-evil-delete)
|
||||
(evil-org-delete-char . evil-mc-execute-default-evil-delete)
|
||||
(evil-org-delete-backward-char . evil-mc-execute-default-evil-delete)
|
||||
;; `evil-numbers'
|
||||
(evil-escape . evil-mc-execute-default-evil-normal-state) ; C-g
|
||||
(evil-numbers/inc-at-pt-incremental)
|
||||
(evil-numbers/dec-at-pt-incremental)))
|
||||
(cl-pushnew `(,(car fn) (:default . ,(or (cdr fn) #'evil-mc-execute-default-call-with-count)))
|
||||
evil-mc-custom-known-commands
|
||||
:test #'eq
|
||||
:key #'car))
|
||||
(evil-numbers/dec-at-pt-incremental)
|
||||
;; :tools eval
|
||||
(+eval:replace-region . +multiple-cursors-execute-default-operator-fn)
|
||||
;; :lang org
|
||||
(evil-org-delete . evil-mc-execute-default-evil-delete)))
|
||||
(setf (alist-get (car fn) evil-mc-custom-known-commands)
|
||||
(list (cons :default
|
||||
(or (cdr fn)
|
||||
#'evil-mc-execute-default-call-with-count)))))
|
||||
|
||||
;; HACK Allow these commands to be repeated by prefixing them with a numerical
|
||||
;; argument. See gabesoft/evil-mc#110
|
||||
@@ -102,12 +104,12 @@
|
||||
;; our multiple cursors
|
||||
(add-hook 'evil-insert-state-entry-hook #'evil-mc-resume-cursors)
|
||||
|
||||
;; evil-escape's escape key sequence leaves behind extraneous characters
|
||||
(cl-pushnew 'evil-escape-mode evil-mc-incompatible-minor-modes)
|
||||
;; Lispy commands don't register on more than 1 cursor. Lispyville is fine
|
||||
;; though.
|
||||
(when (featurep! :editor lispy)
|
||||
(cl-pushnew 'lispy-mode evil-mc-incompatible-minor-modes))
|
||||
(pushnew! evil-mc-incompatible-minor-modes
|
||||
;; evil-escape's escape key leaves behind extraneous characters
|
||||
'evil-escape-mode
|
||||
;; Lispy commands don't register on more than 1 cursor. Lispyville
|
||||
;; is fine though.
|
||||
'lispy-mode)
|
||||
|
||||
(add-hook! 'doom-escape-hook
|
||||
(defun +multiple-cursors-escape-multiple-cursors-h ()
|
||||
@@ -132,6 +134,9 @@
|
||||
(after! multiple-cursors-core
|
||||
(setq mc/list-file (concat doom-etc-dir "mc-lists.el"))
|
||||
|
||||
;; Can't use `mc/cmds-to-run-once' because mc-lists.el overwrites it
|
||||
(add-to-list 'mc--default-cmds-to-run-once 'swiper-mc)
|
||||
|
||||
;; TODO multiple-cursors config for Emacs users?
|
||||
|
||||
;; mc doesn't play well with evil, this attempts to assuage some of its
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
(cond
|
||||
((featurep! :editor evil)
|
||||
;; REVIEW Broken in 8abf2c1f4f0ade64cbb06c8f47055f04ab83e8d6 (latest commit at
|
||||
;; time of writing). Revisit later.
|
||||
(package! iedit :pin "77eb0a1e2e44b453e4ebf4c38409affa353f5139")
|
||||
(package! evil-multiedit :pin "9f271e0e6048297692f80ed6c5ae8994ac523abc")
|
||||
(package! evil-mc :pin "4d4c0172e4c7f80acc1d0e73d5fb3e536929b262"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user