3

Within multiple-cursors-core.el <return> key is bound to multiple-cursors-mode which always ends multiple-cursors-mode, when I'd like to insert a new line.
I can unbind the key with

(define-key mc/keymap (kbd "<return>") nil)

But I wonder: is there more intended by binding <return> to multiple-cursors-mode, then just quiting multiple cursors mode?

2

Type C-j [bound by default to electric-newline-and-maybe-indent], or C-q C-j [just a plain hard return], to insert a hard return when using the multiple-cursors library. The readme.md file contains the following excerpt:

To get out of multiple-cursors-mode, press <return> or C-g.
The latter will first disable multiple regions before disabling multiple cursors.
If you want to insert a newline in multiple-cursors-mode, use C-j.

Magnar most definitely intended that the return/enter key would exit multiple-cursors-mode; i.e., it is bound to multiple-cursors-mode which causes the minor-mode to turn off if it was active:

https://github.com/magnars/multiple-cursors.el/blob/master/multiple-cursors-core.el#L468

See also https://github.com/magnars/multiple-cursors.el/blob/master/multiple-cursors-core.el#L534 to examine the if/then statement.

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.