Move evil-mc library to editor/multiple-cursors
This commit is contained in:
parent
7ca2b42d2b
commit
5baaf08246
5 changed files with 17 additions and 13 deletions
|
@ -395,9 +395,9 @@
|
||||||
:nv "N" #'evil-mc-make-and-goto-last-cursor
|
:nv "N" #'evil-mc-make-and-goto-last-cursor
|
||||||
:nv "p" #'evil-mc-make-and-goto-prev-cursor
|
:nv "p" #'evil-mc-make-and-goto-prev-cursor
|
||||||
:nv "P" #'evil-mc-make-and-goto-first-cursor
|
:nv "P" #'evil-mc-make-and-goto-first-cursor
|
||||||
:nv "t" #'+evil/mc-toggle-cursors
|
:nv "t" #'+multiple-cursors/evil-mc-toggle-cursors
|
||||||
:nv "u" #'evil-mc-undo-all-cursors
|
:nv "u" #'evil-mc-undo-all-cursors
|
||||||
:nv "z" #'+evil/mc-make-cursor-here)
|
:nv "z" #'+multiple-cursors/evil-mc-make-cursor-here)
|
||||||
(:after evil-mc
|
(:after evil-mc
|
||||||
:map evil-mc-key-map
|
:map evil-mc-key-map
|
||||||
:nv "C-n" #'evil-mc-make-and-goto-next-cursor
|
:nv "C-n" #'evil-mc-make-and-goto-next-cursor
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
;;; feature/evil/autoload/evil-mc.el -*- lexical-binding: t; -*-
|
;;; editor/multiple-cursors/autoload/evil-mc.el -*- lexical-binding: t; -*-
|
||||||
|
;;;###if (featurep! :feature evil)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +evil/mc-toggle-cursors ()
|
(defun +multiple-cursors/evil-mc-toggle-cursors ()
|
||||||
"Toggle frozen state of evil-mc cursors."
|
"Toggle frozen state of evil-mc cursors."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq evil-mc-frozen (not (and (evil-mc-has-cursors-p)
|
(setq evil-mc-frozen (not (and (evil-mc-has-cursors-p)
|
||||||
|
@ -10,8 +11,8 @@
|
||||||
(message "evil-mc paused")
|
(message "evil-mc paused")
|
||||||
(message "evil-mc resumed")))
|
(message "evil-mc resumed")))
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil/mc-make-cursor-here "feature/evil/autoload/evil-mc" nil t)
|
;;;###autoload (autoload '+multiple-cursors/evil-mc-make-cursor-here "editor/multiple-cursors/autoload/evil-mc" nil t)
|
||||||
(evil-define-command +evil/mc-make-cursor-here ()
|
(evil-define-command +multiple-cursors/evil-mc-make-cursor-here ()
|
||||||
"Create a cursor at point. If in visual block or line mode, then create
|
"Create a cursor at point. If in visual block or line mode, then create
|
||||||
cursors on each line of the selection, on the column of the cursor. Otherwise
|
cursors on each line of the selection, on the column of the cursor. Otherwise
|
||||||
pauses cursors."
|
pauses cursors."
|
||||||
|
@ -43,8 +44,8 @@ pauses cursors."
|
||||||
;; I assume I don't want the cursors to move yet
|
;; I assume I don't want the cursors to move yet
|
||||||
(evil-mc-make-cursor-here))))
|
(evil-mc-make-cursor-here))))
|
||||||
|
|
||||||
;;;###autoload (autoload '+evil:mc "feature/evil/autoload/evil-mc" nil t)
|
;;;###autoload (autoload '+multiple-cursors:evil-mc "editor/multiple-cursors/autoload/evil-mc" nil t)
|
||||||
(evil-define-command +evil:mc (beg end type pattern &optional bang)
|
(evil-define-command +multiple-cursors:evil-mc (beg end type pattern &optional bang)
|
||||||
"Create mc cursors at each match of PATTERN within BEG and END, and leave the
|
"Create mc cursors at each match of PATTERN within BEG and END, and leave the
|
||||||
cursor at the final match. If BANG, then treat PATTERN as literal."
|
cursor at the final match. If BANG, then treat PATTERN as literal."
|
||||||
:move-point nil
|
:move-point nil
|
|
@ -47,9 +47,14 @@
|
||||||
t))
|
t))
|
||||||
(add-hook 'doom-escape-hook #'+multiple-cursors|escape-multiple-cursors)
|
(add-hook 'doom-escape-hook #'+multiple-cursors|escape-multiple-cursors)
|
||||||
|
|
||||||
;;
|
;; Forward declare these so that ex completion and evil-mc support is
|
||||||
|
;; recognized before the autoloaded functions are loaded.
|
||||||
(evil-add-command-properties '+evil:align :evil-mc t)
|
(evil-add-command-properties '+evil:align :evil-mc t)
|
||||||
(evil-add-command-properties '+evil:mc :evil-mc t))
|
(evil-set-command-properties '+multiple-cursors:evil-mc
|
||||||
|
:move-point nil
|
||||||
|
:ex-arg 'global-match
|
||||||
|
:ex-bang t
|
||||||
|
:evil-mc t))
|
||||||
|
|
||||||
|
|
||||||
(def-package! multiple-cursors
|
(def-package! multiple-cursors
|
||||||
|
|
|
@ -61,7 +61,7 @@ This command understands vim file modifiers (like %:p:h). See
|
||||||
(evil-ex-define-cmd "ral[ign]" #'+evil:align-right)
|
(evil-ex-define-cmd "ral[ign]" #'+evil:align-right)
|
||||||
(evil-ex-define-cmd "enhtml" #'+web:encode-html-entities)
|
(evil-ex-define-cmd "enhtml" #'+web:encode-html-entities)
|
||||||
(evil-ex-define-cmd "dehtml" #'+web:decode-html-entities)
|
(evil-ex-define-cmd "dehtml" #'+web:decode-html-entities)
|
||||||
(evil-ex-define-cmd "mc" #'+evil:mc)
|
(evil-ex-define-cmd "mc" #'+multiple-cursors:evil-mc)
|
||||||
(evil-ex-define-cmd "iedit" #'evil-multiedit-ex-match)
|
(evil-ex-define-cmd "iedit" #'evil-multiedit-ex-match)
|
||||||
(evil-ex-define-cmd "na[rrow]" #'+evil:narrow-buffer)
|
(evil-ex-define-cmd "na[rrow]" #'+evil:narrow-buffer)
|
||||||
(evil-ex-define-cmd "retab" #'+evil:retab)
|
(evil-ex-define-cmd "retab" #'+evil:retab)
|
||||||
|
|
|
@ -166,8 +166,6 @@ line with a linewise comment.")
|
||||||
;; functions aren't loaded yet.
|
;; functions aren't loaded yet.
|
||||||
(evil-set-command-properties
|
(evil-set-command-properties
|
||||||
'+evil:align :move-point t :ex-arg 'buffer-match :ex-bang t :keep-visual t :suppress-operator t)
|
'+evil:align :move-point t :ex-arg 'buffer-match :ex-bang t :keep-visual t :suppress-operator t)
|
||||||
(evil-set-command-properties
|
|
||||||
'+evil:mc :move-point nil :ex-arg 'global-match :ex-bang t)
|
|
||||||
|
|
||||||
;; `evil-collection'
|
;; `evil-collection'
|
||||||
(when (featurep! +everywhere)
|
(when (featurep! +everywhere)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue