Move evil-mc library to editor/multiple-cursors

This commit is contained in:
Henrik Lissner 2019-01-28 19:54:55 -05:00
parent 7ca2b42d2b
commit 5baaf08246
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395
5 changed files with 17 additions and 13 deletions

View File

@ -395,9 +395,9 @@
: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-first-cursor
:nv "t" #'+evil/mc-toggle-cursors
:nv "t" #'+multiple-cursors/evil-mc-toggle-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
:map evil-mc-key-map
:nv "C-n" #'evil-mc-make-and-goto-next-cursor

View File

@ -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
(defun +evil/mc-toggle-cursors ()
(defun +multiple-cursors/evil-mc-toggle-cursors ()
"Toggle frozen state of evil-mc cursors."
(interactive)
(setq evil-mc-frozen (not (and (evil-mc-has-cursors-p)
@ -10,8 +11,8 @@
(message "evil-mc paused")
(message "evil-mc resumed")))
;;;###autoload (autoload '+evil/mc-make-cursor-here "feature/evil/autoload/evil-mc" nil t)
(evil-define-command +evil/mc-make-cursor-here ()
;;;###autoload (autoload '+multiple-cursors/evil-mc-make-cursor-here "editor/multiple-cursors/autoload/evil-mc" nil t)
(evil-define-command +multiple-cursors/evil-mc-make-cursor-here ()
"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
pauses cursors."
@ -43,8 +44,8 @@ pauses cursors."
;; I assume I don't want the cursors to move yet
(evil-mc-make-cursor-here))))
;;;###autoload (autoload '+evil:mc "feature/evil/autoload/evil-mc" nil t)
(evil-define-command +evil:mc (beg end type pattern &optional bang)
;;;###autoload (autoload '+multiple-cursors:evil-mc "editor/multiple-cursors/autoload/evil-mc" nil t)
(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
cursor at the final match. If BANG, then treat PATTERN as literal."
:move-point nil

View File

@ -47,9 +47,14 @@
t))
(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: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

View File

@ -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 "enhtml" #'+web:encode-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 "na[rrow]" #'+evil:narrow-buffer)
(evil-ex-define-cmd "retab" #'+evil:retab)

View File

@ -166,8 +166,6 @@ line with a linewise comment.")
;; functions aren't loaded yet.
(evil-set-command-properties
'+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'
(when (featurep! +everywhere)