0

emacs 26

in my scratch buffer I select dash

enter image description here

Now I want to show multicursors only from cursor position (line 5).

M-x mc/mark-all-like-this

But it show multicursors in whole buffer

enter image description here

I also try M-x mc/mark-next-like-this enter image description here

But it not help. enter image description here

But I need to show multicursors only from cursor position (line 5).

  • 3
    The simplest solution in these cases is to narrow your buffer so you can safely edit a known chunk of your buffer. – Juancho Jan 12 '19 at 15:55
  • Could you please rephrase? From where to where do you want multiple cursors? "show multicursors only from cursor position (line 5)" does not make much sense in conjunction with multiple-cursors. – jue Jan 17 '19 at 11:15
  • @jue multicursors must be only from "aa-bb" to "cc-dd" (only 4 rows) – a_subscriber Jan 17 '19 at 12:59
  • Then its simple. Do M-x mc/mark-next-like-this 3 times and your problem is solved. – jue Jan 17 '19 at 14:37
0

multiple-cursors provides the functions mc/mark-next-like-this and mc/mark-previous-like-this for this. See the manual for more details.

  • It's not help. I updated my post – a_subscriber Jan 17 '19 at 8:43
  • If you look at the multiple cursors manual and demos, the usual way to do this is bind mc/mark-next-like-this to C->. Then you can press C-> three times to mark the four spots you want. – Tyler Jan 17 '19 at 14:27
  • but if I has 100 lines. I need to press C-> 100 times. I think it's not good. – a_subscriber Jan 17 '19 at 14:29
  • 1
    If you want to mark all the hyphens to the end of the buffer, just hold the key down until it stops adding more - it will give you the message "no more matches found" – Tyler Jan 17 '19 at 14:34
  • 3
    @Alexei did you know, that you can do stuff multiple times by pressing Control and the number keys before pressing the shortcut you want? For example C-3 C-> to mark all 4 lines at once. Maybe it is a good idea to read the manuals. – jue Jan 17 '19 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.