Micro: Multiple cursor is not sublime-like

Created on 25 Dec 2018  路  9Comments  路  Source: zyedidia/micro

I originally posted this as a comment in https://github.com/zyedidia/micro/issues/5, but since that issue was closed long ago, I'm opening a new issue.

Sublime and vscode (not sure about atom) do something slightly different about multiple cursors, that I find _very_ useful:

  • If the cursor is at the start, in the middle or at the end of a word, ctrl+d expands the selection to the whole word and, if pressed again, places another cursor to the next match "whole word" that it finds.
  • If there is a selection of characters (even whitespaces), ctrl+d places another cursor to the exact next match.

Moreover the match can be case sensitive or not, depending on the current configuration on the search function.

e.g
Starting from: |test or test| or te|st
image
image
image

Starting from: test and pressing ctrl+d four times
image

Most helpful comment

This will be fixed in the next version of micro.

All 9 comments

Came here to ask for this exact feature. This is by far the best feature in Sublime, and I'm glad all other editors are starting to add it to. It's extremely useful and easy to use. I really hope Micro adds it.

Doesn't Alt-N currently do this? and Alt-X do the skipping thing. The only thing from your your suggestion I don't see is matching whole words only/depending on the search function(?)

Yes, I think so.

However, micro is advertised with sublime-like multi cursors support, at least this is the main reason why I installed it.
I think that it may be a good idea to install sublime and check yourself how the multi cursors work in sublime, in order to have the same behaviour. I'm just a user of both.

This will be fixed in the next version of micro.

  • Highlighting same words on selection would be awesome (like the picture bellow) I guess this would be included as it's part of the request... case sensitive highlighting could be defined with the current search option "ignorecase"
    image

  • An other related improvement "alt+x" could be assigned to "find next" if no selection is made (i mean search last searched text)

Any way thanks a lot for your work and your application is amazing :)

My question is just how to even get multiple cursors happening?

Could not see it in the help anywhere

In Sublime it is Cmd+click

You can use Ctrl-MouseLeft to create a multicursor, and alt-n to create a new one based on the current word (ctrl-d behavior from sublime).

Also it appears I forgot to close this issue, but I believe it is fixed at this point.

ah right, Ctrl+MouseLeft doesn't work in iTerm2 by default as that brings up the right-click menu

I'll see if I can configure that, iTerm2's default binding there is not very useful

I think to configure that in iTerm2, go to Preferences->Pointer and check the box that says "^-Click reported to apps, does not open menu." I would also recommend choosing "xterm defaults" under Preferences->Profiles->Keys->Presets....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xintrea picture xintrea  路  3Comments

aerth picture aerth  路  4Comments

DoTheEvo picture DoTheEvo  路  3Comments

Bigguy34 picture Bigguy34  路  3Comments

Mohamed3on picture Mohamed3on  路  3Comments