[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 80fdb6f 007/434: Hook multiple-cursors in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 80fdb6f 007/434: Hook multiple-cursors into mark-multiple, first step: |
Date: |
Sat, 7 Aug 2021 09:19:44 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 80fdb6f68de4cd3ee62eabde2c1f3f690fd47f58
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Hook multiple-cursors into mark-multiple, first step:
- C-g in mark-multiple takes you to multiple-cursors
Note: C-g again to remove extra cursors
---
multiple-cursors.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/multiple-cursors.el b/multiple-cursors.el
index dcf8d28..2329afa 100644
--- a/multiple-cursors.el
+++ b/multiple-cursors.el
@@ -97,7 +97,7 @@ from being executed if in multiple-cursors-mode."
(unless multiple-cursors-mode
ad-do-it))))
-;; Commands that makes a giant mess of multiple cursors
+;; Commands that make a giant mess of multiple cursors
(unsupported-cmd yank-pop)
;; Commands that should be mirrored by all cursors
@@ -114,8 +114,8 @@ from being executed if in multiple-cursors-mode."
kill-region-or-backward-word
backward-kill-word
backward-delete-char-untabify
- delete-char
- delete-backward-char
+ delete-char c-electric-delete-forward
+ delete-backward-char c-electric-backspace
zap-to-char
move-end-of-line-or-next-line
move-start-of-line-or-prev-line))
@@ -216,6 +216,20 @@ mark-multiple if point and mark is on different columns."
(mc/execute-command-for-all-cursors 'beginning-of-line)
(beginning-of-line))
+(defun mc/switch-to-cursors-from-mark-multiple ()
+ "Removes mark-multiple and switches to multiple cursors instead"
+ (interactive)
+ (let ((offset (- (point) (overlay-start mm/master))))
+ (save-excursion
+ (dolist (mirror mm/mirrors)
+ (goto-char (+ offset (overlay-start mirror)))
+ (mc/add-cursor-at-point)))
+ (mm/clear-all)
+ (deactivate-mark)
+ (multiple-cursors-mode)))
+
+(define-key mm/keymap (kbd "C-g") 'mc/switch-to-cursors-from-mark-multiple)
+
(provide 'multiple-cursors)
;;; multiple-cursors.el ends here
- [nongnu] elpa/multiple-cursors cf82088 014/434: Add backward-list to white-list., (continued)
- [nongnu] elpa/multiple-cursors cf82088 014/434: Add backward-list to white-list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 26d0e52 015/434: Add more commands to white-list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5e64246 025/434: Move todo to own file., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e0ffd9c 026/434: Disable marker when done with it, for performance reasons., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9938aca 028/434: Save er/history for each cursor, to be able to contract., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dfe8a2d 029/434: Slight optimisation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6c0e16e 033/434: More things to do., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 07a4411 036/434: More things to do., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 75581da 037/434: Fix bug with expand-region dependency., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8d49171 039/434: Update todo, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 80fdb6f 007/434: Hook multiple-cursors into mark-multiple, first step:,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 9182897 046/434: Add message about delete-char vs delete-forward-char, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c34e4df 064/434: Don't grow cursor overlays., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 382616a 020/434: Don't get annoyed so easily at multiple cursors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b99d54a 047/434: Fix error message., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4c56cb8 065/434: Tests for white-list prompt., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4078570 066/434: Switch to multiple-cursors-mode from rectangular-region with <return>, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b2906bb 097/434: Don't forget to autoload, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 16563e3 104/434: Add hooks when mc-mode is enabled and disabled., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 6926ca3 105/434: Avoid strange smooth-scrolling behavior., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 059ee6b 109/434: Merge pull request #7 from Mon-Ouie/fix/macro-expansion, ELPA Syncer, 2021/08/07