mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2026-05-10 01:18:19 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb7a145153 | |||
| 82a1fe3746 | |||
| 56839dfdca | |||
| 3f3cdc6c92 | |||
| 5190e0cdc6 | |||
| a4f6ea179a | |||
| 9582c7220b | |||
| a6984a1141 | |||
| 6a5969e14a | |||
| 9a376a6fa2 | |||
| bfb293f200 | |||
| 3ce6e4a670 | |||
| 424e0667a4 | |||
| f1a5a39b48 | |||
| 84ab4ee26a | |||
| 07b88080b1 | |||
| e7605bbd7c | |||
| dc0aa99459 | |||
| 6339657440 | |||
| 94164f706a | |||
| 52300ff852 |
@@ -49,6 +49,9 @@ You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.co
|
|||||||
|
|
||||||
### Mark many occurrences
|
### Mark many occurrences
|
||||||
|
|
||||||
|
- `mc/edit-lines`: Adds one cursor to each line in the current region.
|
||||||
|
- `mc/edit-beginnings-of-lines`: Adds a cursor at the start of each line in the current region.
|
||||||
|
- `mc/edit-ends-of-lines`: Adds a cursor at the end of each line in the current region.
|
||||||
- `mc/mark-all-like-this`: Marks all parts of the buffer that matches the current region.
|
- `mc/mark-all-like-this`: Marks all parts of the buffer that matches the current region.
|
||||||
- `mc/mark-all-words-like-this`: Like `mc/mark-all-like-this` but only for whole words.
|
- `mc/mark-all-words-like-this`: Like `mc/mark-all-like-this` but only for whole words.
|
||||||
- `mc/mark-all-symbols-like-this`: Like `mc/mark-all-like-this` but only for whole symbols.
|
- `mc/mark-all-symbols-like-this`: Like `mc/mark-all-like-this` but only for whole symbols.
|
||||||
@@ -62,6 +65,9 @@ You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.co
|
|||||||
|
|
||||||
- `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region.
|
- `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region.
|
||||||
- `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag.
|
- `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag.
|
||||||
|
- `mc/insert-numbers`: Insert increasing numbers for each cursor, top to bottom.
|
||||||
|
- `mc/sort-regions`: Sort the marked regions alphabetically.
|
||||||
|
- `mc/reverse-regions`: Reverse the order of the marked regions.
|
||||||
|
|
||||||
## Tips and tricks
|
## Tips and tricks
|
||||||
|
|
||||||
@@ -72,13 +78,17 @@ You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.co
|
|||||||
- Sometimes you end up with cursors outside of your view. You can
|
- Sometimes you end up with cursors outside of your view. You can
|
||||||
scroll the screen to center on each cursor with `C-v` and `M-v`.
|
scroll the screen to center on each cursor with `C-v` and `M-v`.
|
||||||
|
|
||||||
- Try pressing `mc/mark-next-like-this` with no region selected. It will just add a cursor
|
- Try pressing `mc/mark-next-like-this` with no region selected. It
|
||||||
on the next line.
|
will just add a cursor on the next line.
|
||||||
|
|
||||||
- Try pressing `mc/mark-all-like-this-dwim` on a tagname in html-mode.
|
- Try pressing `mc/mark-all-like-this-dwim` on a tagname in html-mode.
|
||||||
|
|
||||||
- Notice that the number of cursors active can be seen in the modeline.
|
- Notice that the number of cursors active can be seen in the modeline.
|
||||||
|
|
||||||
|
- If you get out of multiple-cursors-mode and yank - it will yank only
|
||||||
|
from the kill-ring of main cursor. To yank from the kill-rings of
|
||||||
|
every cursor use yank-rectangle, normally found at C-x r y.
|
||||||
|
|
||||||
- If you would like to keep the global bindings clean, and get custom keybindings
|
- If you would like to keep the global bindings clean, and get custom keybindings
|
||||||
when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode).
|
when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode).
|
||||||
|
|
||||||
|
|||||||
@@ -42,3 +42,16 @@ Feature: Switching from a multiline region to multiple cursors
|
|||||||
And I go to the front of the word "long"
|
And I go to the front of the word "long"
|
||||||
And I press "C-S-c C-S-c"
|
And I press "C-S-c C-S-c"
|
||||||
Then I should have 2 cursors
|
Then I should have 2 cursors
|
||||||
|
|
||||||
|
Scenario: Edit without using transient mark mode
|
||||||
|
Given I turn off transient-mark-mode
|
||||||
|
And I insert:
|
||||||
|
"""
|
||||||
|
hello
|
||||||
|
there
|
||||||
|
"""
|
||||||
|
And I go to the front of the word "hello"
|
||||||
|
And I set the mark
|
||||||
|
And I go to the front of the word "there"
|
||||||
|
And I press "C-S-c C-S-c"
|
||||||
|
Then I should have 2 cursors
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
Feature: Insert increasing numbers
|
||||||
|
|
||||||
|
Scenario: Three cursors, 0-1-2
|
||||||
|
Given I have cursors at "text" in "This text contains the word text thrice (text)"
|
||||||
|
When I press "H-0"
|
||||||
|
And I press "SPC"
|
||||||
|
Then I should see "This 0 text contains the word 1 text thrice (2 text)"
|
||||||
|
|
||||||
|
Scenario: Three cursors, 9-10-11
|
||||||
|
Given I have cursors at "text" in "This text contains the word text thrice (text)"
|
||||||
|
When I press "C-9 H-0"
|
||||||
|
And I press "SPC"
|
||||||
|
Then I should see "This 9 text contains the word 10 text thrice (11 text)"
|
||||||
@@ -132,3 +132,13 @@ Feature: Marking multiple parts of the buffer
|
|||||||
b_bb
|
b_bb
|
||||||
c_cc
|
c_cc
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Scenario: Multiple cursor with shift selection
|
||||||
|
When I insert "This text contains the word text twice"
|
||||||
|
And I go to the front of the word "text"
|
||||||
|
And I press "M-S-f"
|
||||||
|
And I press "C->"
|
||||||
|
And I press "C-f"
|
||||||
|
And I press "<deletechar>"
|
||||||
|
Then I should see "This text ontains the word text wice"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
Feature: Sorting and reversing cursor regions
|
||||||
|
|
||||||
|
Scenario: Reversing regions
|
||||||
|
Given I have cursors at "text" in "This text contains the word text thrice (text here)"
|
||||||
|
When I press "M-f"
|
||||||
|
And I press "C-f"
|
||||||
|
And I press "C-SPC"
|
||||||
|
And I press "M-f"
|
||||||
|
And I press "H-1"
|
||||||
|
Then I should see "This text here the word text thrice (text contains)"
|
||||||
|
|
||||||
|
Scenario: Sorting regions
|
||||||
|
Given I have cursors at "text" in "This text contains the word text thrice (text here)"
|
||||||
|
When I press "M-f"
|
||||||
|
And I press "C-f"
|
||||||
|
And I press "C-SPC"
|
||||||
|
And I press "M-f"
|
||||||
|
And I press "H-2"
|
||||||
|
Then I should see "This text contains the word text here (text thrice)"
|
||||||
@@ -25,6 +25,9 @@
|
|||||||
(global-set-key (kbd "M-!") 'mc/mark-all-like-this)
|
(global-set-key (kbd "M-!") 'mc/mark-all-like-this)
|
||||||
(global-set-key (kbd "M-$") 'mc/mark-all-like-this-dwim)
|
(global-set-key (kbd "M-$") 'mc/mark-all-like-this-dwim)
|
||||||
(global-set-key (kbd "M-#") 'mc/mark-all-in-region)
|
(global-set-key (kbd "M-#") 'mc/mark-all-in-region)
|
||||||
|
(global-set-key (kbd "H-0") 'mc/insert-numbers)
|
||||||
|
(global-set-key (kbd "H-1") 'mc/reverse-regions)
|
||||||
|
(global-set-key (kbd "H-2") 'mc/sort-regions)
|
||||||
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
||||||
(global-set-key (kbd "H-SPC") 'set-rectangular-region-anchor)
|
(global-set-key (kbd "H-SPC") 'set-rectangular-region-anchor)
|
||||||
(switch-to-buffer
|
(switch-to-buffer
|
||||||
|
|||||||
@@ -113,4 +113,10 @@
|
|||||||
|
|
||||||
(provide 'mc-cycle-cursors)
|
(provide 'mc-cycle-cursors)
|
||||||
|
|
||||||
|
|
||||||
|
;; Local Variables:
|
||||||
|
;; coding: utf-8
|
||||||
|
;; byte-compile-warnings: (not cl-functions)
|
||||||
|
;; End:
|
||||||
|
|
||||||
;;; mc-cycle-cursors.el ends here
|
;;; mc-cycle-cursors.el ends here
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
Starts from mark and moves in straight down or up towards the
|
Starts from mark and moves in straight down or up towards the
|
||||||
line point is on."
|
line point is on."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (not (use-region-p))
|
(when (not (and mark-active (/= (point) (mark))))
|
||||||
(error "Mark a set of lines first."))
|
(error "Mark a set of lines first."))
|
||||||
(mc/remove-fake-cursors)
|
(mc/remove-fake-cursors)
|
||||||
(let* ((col (current-column))
|
(let* ((col (current-column))
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
;;; mc-separate-operations.el - functions that work differently on each cursor
|
||||||
|
|
||||||
|
;; Copyright (C) 2012 Magnar Sveen
|
||||||
|
|
||||||
|
;; Author: Magnar Sveen <magnars@gmail.com>
|
||||||
|
;; Keywords: editing cursors
|
||||||
|
|
||||||
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; This file contains functions that work differently on each cursor,
|
||||||
|
;; instead of treating all of them the same.
|
||||||
|
|
||||||
|
;; Please see multiple-cursors.el for more commentary.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'multiple-cursors-core)
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun mc/insert-numbers (arg)
|
||||||
|
"Insert increasing numbers for each cursor, starting at 0 or ARG."
|
||||||
|
(interactive "P")
|
||||||
|
(setq mc--insert-numbers-number (or arg 0))
|
||||||
|
(mc/for-each-cursor-ordered
|
||||||
|
(mc/execute-command-for-fake-cursor 'mc--insert-number-and-increase cursor)))
|
||||||
|
|
||||||
|
(defvar mc--insert-numbers-number 0)
|
||||||
|
|
||||||
|
(defun mc--insert-number-and-increase ()
|
||||||
|
(interactive)
|
||||||
|
(insert (number-to-string mc--insert-numbers-number))
|
||||||
|
(setq mc--insert-numbers-number (1+ mc--insert-numbers-number)))
|
||||||
|
|
||||||
|
(defun mc--ordered-region-strings ()
|
||||||
|
(let (strings)
|
||||||
|
(save-excursion
|
||||||
|
(mc/for-each-cursor-ordered
|
||||||
|
(add-to-list 'strings (buffer-substring-no-properties
|
||||||
|
(mc/cursor-beg cursor)
|
||||||
|
(mc/cursor-end cursor))))strings)
|
||||||
|
(nreverse strings)))
|
||||||
|
|
||||||
|
(defvar mc--strings-to-replace nil)
|
||||||
|
|
||||||
|
(defun mc--replace-region-strings-1 ()
|
||||||
|
(interactive)
|
||||||
|
(delete-region (region-beginning) (region-end))
|
||||||
|
(insert (car mc--strings-to-replace))
|
||||||
|
(setq mc--strings-to-replace (cdr mc--strings-to-replace)))
|
||||||
|
|
||||||
|
(defun mc--replace-region-strings ()
|
||||||
|
(mc/for-each-cursor-ordered
|
||||||
|
(mc/execute-command-for-fake-cursor 'mc--replace-region-strings-1 cursor)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun mc/reverse-regions ()
|
||||||
|
(interactive)
|
||||||
|
(if (not (use-region-p))
|
||||||
|
(message "Mark regions to reverse first.")
|
||||||
|
(setq mc--strings-to-replace (nreverse (mc--ordered-region-strings)))
|
||||||
|
(mc--replace-region-strings)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun mc/sort-regions ()
|
||||||
|
(interactive)
|
||||||
|
(if (not (use-region-p))
|
||||||
|
(message "Mark regions to sort first.")
|
||||||
|
(setq mc--strings-to-replace (sort (mc--ordered-region-strings) 'string<))
|
||||||
|
(mc--replace-region-strings)))
|
||||||
|
|
||||||
|
(provide 'mc-separate-operations)
|
||||||
|
;;; mc-separate-operations.el ends here
|
||||||
+36
-21
@@ -72,12 +72,12 @@
|
|||||||
|
|
||||||
(defmacro mc/for-each-cursor-ordered (&rest forms)
|
(defmacro mc/for-each-cursor-ordered (&rest forms)
|
||||||
"Runs the body for each cursor, fake and real, bound to the name cursor"
|
"Runs the body for each cursor, fake and real, bound to the name cursor"
|
||||||
`(let ((real-cursor (mc/create-fake-cursor-at-point)))
|
`(let ((real-cursor-id (overlay-get (mc/create-fake-cursor-at-point) 'mc-id)))
|
||||||
(mapc #'(lambda (cursor)
|
(mapc #'(lambda (cursor)
|
||||||
(when (mc/fake-cursor-p cursor)
|
(when (mc/fake-cursor-p cursor)
|
||||||
,@forms))
|
,@forms))
|
||||||
(sort (overlays-in (point-min) (point-max)) 'mc--compare-by-overlay-start))
|
(sort (overlays-in (point-min) (point-max)) 'mc--compare-by-overlay-start))
|
||||||
(mc/pop-state-from-overlay real-cursor)))
|
(mc/pop-state-from-overlay (mc/cursor-with-id real-cursor-id))))
|
||||||
|
|
||||||
(defmacro mc/save-window-scroll (&rest forms)
|
(defmacro mc/save-window-scroll (&rest forms)
|
||||||
"Saves and restores the window scroll position"
|
"Saves and restores the window scroll position"
|
||||||
@@ -120,15 +120,10 @@ highlights the entire width of the window."
|
|||||||
|
|
||||||
(defvar mc/cursor-specific-vars '(autopair-action
|
(defvar mc/cursor-specific-vars '(autopair-action
|
||||||
autopair-wrap-action
|
autopair-wrap-action
|
||||||
|
transient-mark-mode
|
||||||
er/history)
|
er/history)
|
||||||
"A list of vars that need to be tracked on a per-cursor basis.")
|
"A list of vars that need to be tracked on a per-cursor basis.")
|
||||||
|
|
||||||
(defun mc/store-cursor-specific-var (var)
|
|
||||||
(when (boundp var) (overlay-put o var (eval var))))
|
|
||||||
|
|
||||||
(defun mc/restore-cursor-specific-var (var)
|
|
||||||
(when (boundp var) (set var (overlay-get o var))))
|
|
||||||
|
|
||||||
(defun mc/store-current-state-in-overlay (o)
|
(defun mc/store-current-state-in-overlay (o)
|
||||||
"Store relevant info about point and mark in the given overlay."
|
"Store relevant info about point and mark in the given overlay."
|
||||||
(overlay-put o 'point (set-marker (make-marker) (point)))
|
(overlay-put o 'point (set-marker (make-marker) (point)))
|
||||||
@@ -139,7 +134,8 @@ highlights the entire width of the window."
|
|||||||
(overlay-put o 'mark-active mark-active)
|
(overlay-put o 'mark-active mark-active)
|
||||||
(overlay-put o 'yank-undo-function yank-undo-function)
|
(overlay-put o 'yank-undo-function yank-undo-function)
|
||||||
(overlay-put o 'kill-ring-yank-pointer kill-ring-yank-pointer)
|
(overlay-put o 'kill-ring-yank-pointer kill-ring-yank-pointer)
|
||||||
(mapc 'mc/store-cursor-specific-var mc/cursor-specific-vars)
|
(dolist (var mc/cursor-specific-vars)
|
||||||
|
(when (boundp var) (overlay-put o var (symbol-value var))))
|
||||||
o)
|
o)
|
||||||
|
|
||||||
(defun mc/restore-state-from-overlay (o)
|
(defun mc/restore-state-from-overlay (o)
|
||||||
@@ -152,7 +148,8 @@ highlights the entire width of the window."
|
|||||||
(setq mark-active (overlay-get o 'mark-active))
|
(setq mark-active (overlay-get o 'mark-active))
|
||||||
(setq yank-undo-function (overlay-get o 'yank-undo-function))
|
(setq yank-undo-function (overlay-get o 'yank-undo-function))
|
||||||
(setq kill-ring-yank-pointer (overlay-get o 'kill-ring-yank-pointer))
|
(setq kill-ring-yank-pointer (overlay-get o 'kill-ring-yank-pointer))
|
||||||
(mapc 'mc/restore-cursor-specific-var mc/cursor-specific-vars))
|
(dolist (var mc/cursor-specific-vars)
|
||||||
|
(when (boundp var) (set var (overlay-get o var)))))
|
||||||
|
|
||||||
(defun mc/remove-fake-cursor (o)
|
(defun mc/remove-fake-cursor (o)
|
||||||
"Delete overlay with state, including dependent overlays and markers."
|
"Delete overlay with state, including dependent overlays and markers."
|
||||||
@@ -202,6 +199,17 @@ Saves the current state in the overlay to be restored later."
|
|||||||
|
|
||||||
(defvar mc--executing-command-for-fake-cursor nil)
|
(defvar mc--executing-command-for-fake-cursor nil)
|
||||||
|
|
||||||
|
(defun mc/execute-command-for-fake-cursor (cmd cursor)
|
||||||
|
(let ((mc--executing-command-for-fake-cursor t)
|
||||||
|
(id (overlay-get cursor 'mc-id))
|
||||||
|
(annoying-arrows-mode nil)
|
||||||
|
(smooth-scroll-margin 0))
|
||||||
|
(mc/add-fake-cursor-to-undo-list
|
||||||
|
(mc/pop-state-from-overlay cursor)
|
||||||
|
(ignore-errors
|
||||||
|
(mc/execute-command cmd)
|
||||||
|
(mc/create-fake-cursor-at-point id)))))
|
||||||
|
|
||||||
(defun mc/execute-command-for-all-fake-cursors (cmd)
|
(defun mc/execute-command-for-all-fake-cursors (cmd)
|
||||||
"Calls CMD interactively for each cursor.
|
"Calls CMD interactively for each cursor.
|
||||||
It works by moving point to the fake cursor, setting
|
It works by moving point to the fake cursor, setting
|
||||||
@@ -212,15 +220,7 @@ cursor with updated info."
|
|||||||
(mc/save-window-scroll
|
(mc/save-window-scroll
|
||||||
(mc/for-each-fake-cursor
|
(mc/for-each-fake-cursor
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let ((mc--executing-command-for-fake-cursor t)
|
(mc/execute-command-for-fake-cursor cmd cursor)))))
|
||||||
(id (overlay-get cursor 'mc-id))
|
|
||||||
(annoying-arrows-mode nil)
|
|
||||||
(smooth-scroll-margin 0))
|
|
||||||
(mc/add-fake-cursor-to-undo-list
|
|
||||||
(mc/pop-state-from-overlay cursor)
|
|
||||||
(ignore-errors
|
|
||||||
(mc/execute-command cmd)
|
|
||||||
(mc/create-fake-cursor-at-point id))))))))
|
|
||||||
(mc--reset-read-prompts))
|
(mc--reset-read-prompts))
|
||||||
|
|
||||||
;; Intercept some reading commands so you won't have to
|
;; Intercept some reading commands so you won't have to
|
||||||
@@ -344,9 +344,16 @@ the original cursor, to inform about the lack of support."
|
|||||||
|
|
||||||
;; if it's a lambda, we can't know if it's supported or not
|
;; if it's a lambda, we can't know if it's supported or not
|
||||||
;; - so go ahead and assume it's ok, because we're just optimistic like that
|
;; - so go ahead and assume it's ok, because we're just optimistic like that
|
||||||
(if (not (symbolp original-command))
|
(if (or (not (symbolp original-command))
|
||||||
|
;; lambda registered by smartrep
|
||||||
|
(string-prefix-p "(" (symbol-name original-command)))
|
||||||
(mc/execute-command-for-all-fake-cursors original-command)
|
(mc/execute-command-for-all-fake-cursors original-command)
|
||||||
|
|
||||||
|
;; smartrep `intern's commands into own obarray to help
|
||||||
|
;; `describe-bindings'. So, let's re-`intern' here to
|
||||||
|
;; make the command comparable by `eq'.
|
||||||
|
(setq original-command (intern (symbol-name original-command)))
|
||||||
|
|
||||||
;; otherwise it's a symbol, and we can be more thorough
|
;; otherwise it's a symbol, and we can be more thorough
|
||||||
(if (get original-command 'mc--unsupported)
|
(if (get original-command 'mc--unsupported)
|
||||||
(message "%S is not supported with multiple cursors%s"
|
(message "%S is not supported with multiple cursors%s"
|
||||||
@@ -509,7 +516,7 @@ for running commands with multiple cursors.")
|
|||||||
|
|
||||||
(defun mc/dump-list (list-symbol)
|
(defun mc/dump-list (list-symbol)
|
||||||
"Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer."
|
"Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer."
|
||||||
(let ((value (symbol-value list-symbol)))
|
(symbol-macrolet ((value (symbol-value list-symbol)))
|
||||||
(insert "(setq " (symbol-name list-symbol) "\n"
|
(insert "(setq " (symbol-name list-symbol) "\n"
|
||||||
" '(")
|
" '(")
|
||||||
(newline-and-indent)
|
(newline-and-indent)
|
||||||
@@ -558,6 +565,9 @@ for running commands with multiple cursors.")
|
|||||||
mc/mark-all-symbols-like-this-in-defun
|
mc/mark-all-symbols-like-this-in-defun
|
||||||
mc/mark-all-like-this-dwim
|
mc/mark-all-like-this-dwim
|
||||||
mc/mark-sgml-tag-pair
|
mc/mark-sgml-tag-pair
|
||||||
|
mc/insert-numbers
|
||||||
|
mc/sort-regions
|
||||||
|
mc/reverse-regions
|
||||||
mc/cycle-forward
|
mc/cycle-forward
|
||||||
mc/cycle-backward
|
mc/cycle-backward
|
||||||
rrm/switch-to-multiple-cursors
|
rrm/switch-to-multiple-cursors
|
||||||
@@ -684,4 +694,9 @@ for running commands with multiple cursors.")
|
|||||||
|
|
||||||
(provide 'multiple-cursors-core)
|
(provide 'multiple-cursors-core)
|
||||||
|
|
||||||
|
;; Local Variables:
|
||||||
|
;; coding: utf-8
|
||||||
|
;; byte-compile-warnings: (not cl-functions)
|
||||||
|
;; End:
|
||||||
|
|
||||||
;;; multiple-cursors-core.el ends here
|
;;; multiple-cursors-core.el ends here
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
(define-package "multiple-cursors" "1.1.4"
|
(define-package "multiple-cursors" "1.2.0"
|
||||||
"Multiple cursors for Emacs.")
|
"Multiple cursors for Emacs.")
|
||||||
|
|||||||
@@ -82,6 +82,9 @@
|
|||||||
|
|
||||||
;; - `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region.
|
;; - `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region.
|
||||||
;; - `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag.
|
;; - `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag.
|
||||||
|
;; - `mc/insert-numbers`: Insert increasing numbers for each cursor, top to bottom.
|
||||||
|
;; - `mc/sort-regions`: Sort the marked regions alphabetically.
|
||||||
|
;; - `mc/reverse-regions`: Reverse the order of the marked regions.
|
||||||
|
|
||||||
;; ## Tips and tricks
|
;; ## Tips and tricks
|
||||||
|
|
||||||
@@ -99,6 +102,10 @@
|
|||||||
|
|
||||||
;; - Notice that the number of cursors active can be seen in the modeline.
|
;; - Notice that the number of cursors active can be seen in the modeline.
|
||||||
|
|
||||||
|
;; - If you get out of multiple-cursors-mode and yank - it will yank only
|
||||||
|
;; from the kill-ring of main cursor. To yank from the kill-rings of
|
||||||
|
;; every cursor use yank-rectangle, normally found at C-x r y.
|
||||||
|
|
||||||
;; - If you would like to keep the global bindings clean, and get custom keybindings
|
;; - If you would like to keep the global bindings clean, and get custom keybindings
|
||||||
;; when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode).
|
;; when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode).
|
||||||
|
|
||||||
@@ -159,6 +166,7 @@
|
|||||||
(require 'mc-cycle-cursors)
|
(require 'mc-cycle-cursors)
|
||||||
(require 'mc-mark-more)
|
(require 'mc-mark-more)
|
||||||
(require 'rectangular-region-mode)
|
(require 'rectangular-region-mode)
|
||||||
|
(require 'mc-separate-operations)
|
||||||
|
|
||||||
(provide 'multiple-cursors)
|
(provide 'multiple-cursors)
|
||||||
|
|
||||||
|
|||||||
+4
-12
@@ -1,20 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
set_default () {
|
ECUKES_EMACS=${ECUKES_EMACS:-$(which emacs)}
|
||||||
eval "
|
|
||||||
if [ -z \$$1 ]; then
|
|
||||||
$1=$2
|
|
||||||
fi
|
|
||||||
"
|
|
||||||
}
|
|
||||||
|
|
||||||
set_default ECUKES_EMACS "$(which emacs)"
|
|
||||||
|
|
||||||
echo "*** Emacs version ***"
|
echo "*** Emacs version ***"
|
||||||
echo "ECUKES_EMACS =" $(which $ECUKES_EMACS)
|
echo "ECUKES_EMACS = $ECUKES_EMACS"
|
||||||
$ECUKES_EMACS --version
|
"$ECUKES_EMACS" --version
|
||||||
echo
|
echo
|
||||||
|
|
||||||
exec ./util/ecukes/ecukes --graphical
|
exec ./util/ecukes/ecukes --graphical
|
||||||
|
|||||||
Reference in New Issue
Block a user