Hi! Has anyone set up Evil with multiple-cursors? I’ve just started investigating multiple-cursors and it seems preferable over iedit. It doesn’t play as well with Evil, however, at least not out of the box, and I was wondering if there are some obvious changes to make to get them to work well together.
Am Mon, 26 Aug 2013 13:38:25 +0200 schrieb Nikolai Weibull <[email protected]>:
Has anyone set up Evil with multiple-cursors? I’ve just started investigating multiple-cursors and it seems preferable over iedit. It doesn’t play as well with Evil, however, at least not out of the box, and I was wondering if there are some obvious changes to make to get them to work well together.
I've never used multiple-cursors which more or less implies that there's no code in Evil to make both work together. And probably this is not so trivial (maybe in insert-state only, but certainly not in normal-state). But of course, patches are welcome ;) Frank
On Mon, Aug 26, 2013 at 8:31 PM, Frank Fischer <[email protected]> wrote:
Am Mon, 26 Aug 2013 13:38:25 +0200 schrieb Nikolai Weibull <[email protected]>:
Has anyone set up Evil with multiple-cursors? I’ve just started investigating multiple-cursors and it seems preferable over iedit. It doesn’t play as well with Evil, however, at least not out of the box, and I was wondering if there are some obvious changes to make to get them to work well together.
I've never used multiple-cursors which more or less implies that there's no code in Evil to make both work together.
It’s actually rather nice. For those who haven’t seen it in action, here’s a screencast: http://emacsrocks.com/e13.html
And probably this is not so trivial (maybe in insert-state only, but certainly not in normal-state).
But of course, patches are welcome ;)
I haven’t looked at the code, but my guess is that implementing this shouldn’t be too difficult. The code should in many ways be similar to that handling visual block mode. Actually, multiple-cursors mode is really an extension of visual block mode, as visual block mode is more or less multiple-cursors mode limited to continuous lines anchored at a specific column. I won’t have time to look at this right now, but if no one else has a better solution, I’ll certainly look at it sometime in September.
There are a couple of open issues filed for multiple-cursors that mention evil. Here's the main one: https://github.com/magnars/multiple-cursors.el/issues/17 On Tue, Aug 27, 2013 at 3:53 AM, Nikolai Weibull <[email protected]> wrote:
On Mon, Aug 26, 2013 at 8:31 PM, Frank Fischer <[email protected]> wrote:
Am Mon, 26 Aug 2013 13:38:25 +0200 schrieb Nikolai Weibull <[email protected]>:
Has anyone set up Evil with multiple-cursors? I’ve just started investigating multiple-cursors and it seems preferable over iedit. It doesn’t play as well with Evil, however, at least not out of the box, and I was wondering if there are some obvious changes to make to get them to work well together.
I've never used multiple-cursors which more or less implies that there's no code in Evil to make both work together.
It’s actually rather nice. For those who haven’t seen it in action, here’s a screencast:
http://emacsrocks.com/e13.html
And probably this is not so trivial (maybe in insert-state only, but certainly not in normal-state).
But of course, patches are welcome ;)
I haven’t looked at the code, but my guess is that implementing this shouldn’t be too difficult. The code should in many ways be similar to that handling visual block mode.
Actually, multiple-cursors mode is really an extension of visual block mode, as visual block mode is more or less multiple-cursors mode limited to continuous lines anchored at a specific column.
I won’t have time to look at this right now, but if no one else has a better solution, I’ll certainly look at it sometime in September.
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
On Tue, Aug 27, 2013 at 1:43 PM, Tom Short <[email protected]> wrote:
There are a couple of open issues filed for multiple-cursors that mention evil. Here's the main one:
Yeah, I saw that. I figured that since newest comment is three months old, not much progress was to be expected.
Nikolai Weibull <[email protected]> writes:
I've never used multiple-cursors which more or less implies that there's no code in Evil to make both work together.
It’s actually rather nice. For those who haven’t seen it in action, here’s a screencast:
http://emacsrocks.com/e13.html
And probably this is not so trivial (maybe in insert-state only, but certainly not in normal-state).
But of course, patches are welcome ;)
I haven’t looked at the code, but my guess is that implementing this shouldn’t be too difficult. The code should in many ways be similar to that handling visual block mode.
Actually, multiple-cursors mode is really an extension of visual block mode, as visual block mode is more or less multiple-cursors mode limited to continuous lines anchored at a specific column.
I do not know for sure (I haven't looked into the code), but I assume multiple-cursors does its magic by repeating each called command once for each of the cursors, i.e. something like (add-hook 'post-command-hook (lambda () (dolist (c cursors) (save-excursion (call-interactively this-command) ...)))) However, Evil commands, in particular operators, are quite complex. When an operator is called then another command, the motion, is called intermediately, i.e. after the operator is started but before it is finished (using a complex interactive code). But this implies that reproducing an operator is not trivial. Evil needs several tricks in order to record all commands correctly so that they can be repeated later (the "dot" command). However, you're right, Evil's block insertion is similar to what multiple-cursors does and it is based on Evil's repeat-recording mechanisms. So it is possibly easier to mimic multiple-cursors' features on top of Evil's repeat system, which would be more robust and integrate nicely in Evil's ecosystem -- but then one would not need multiple-cursors anymore in Evil. This should not be too difficult because all recording/repeating functionality is already there.
I won’t have time to look at this right now, but if no one else has a better solution, I’ll certainly look at it sometime in September.
This would be nice. Best regards, Frank
participants (4)
-
Frank Fischer -
Frank Fischer -
Nikolai Weibull -
Tom Short