vim-multiple-cursors icon indicating copy to clipboard operation
vim-multiple-cursors copied to clipboard

A new multiple cursors plugin

Open mg979 opened this issue 8 years ago • 14 comments

Hi, I just wanted to say that I've been working on a new multiple cursors plugin for the past couple of months. I think it has reached a point where it is usable, but I'd appreciate if somebody could help me with testing. I'm also open to suggestions/ideas. I hope it's not too bold to advertize it here, thanks for the understanding.

There is also a test branch with some improvements, if somebody wants to use that (for testing it would be better).

Main page Documentation

Some pics:

Imgur Imgur Imgur

mg979 avatar May 21 '18 07:05 mg979

Looks very promising! I remember your message several months ago, but then the plugin worked in read-only mode. Glad to see you've developed it further!

My number one suggestion is to introduce unit testing and ensure regressions are not happening.

balta2ar avatar May 21 '18 09:05 balta2ar

Thanks, I have no idea about unit testing, do you know where I can get some instructions?

mg979 avatar May 21 '18 09:05 mg979

This repo contains certain number of unit tests, take a look at them: https://github.com/terryma/vim-multiple-cursors/blob/master/spec/multiple_cursors_spec.rb. Another plugin with a lot of testing is https://github.com/w0rp/ale. I think it's a great resource to learn from.

balta2ar avatar May 21 '18 09:05 balta2ar

I will look at them, definitely I have to learn all that! I had lots of problems with regressions at a certain point, I got past, hopefully.

mg979 avatar May 21 '18 09:05 mg979

Looks great. But why dont you participate to vim-multiple-cursors instead of creating a new plugin?

Is there any structural limitation that would require vim-multiple-cursors to be rewritten from scratch?

On Mon, May 21, 2018, 2:33 AM mg979 [email protected] wrote:

I will look at them, definitely I have to learn all that! I had lots of problems with regressions at a certain point, I got past, hopefully.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/terryma/vim-multiple-cursors/issues/271#issuecomment-390603831, or mute the thread https://github.com/notifications/unsubscribe-auth/AKVDAoFfNoWNrgCw2WbkAztLqEXJ4PQrks5t0ontgaJpZM4UGlLK .

antoinemadec avatar May 21 '18 14:05 antoinemadec

I had a look at the plugin before starting a new one, for me structural limitations are:

  • it's all in one script, making it hard to add new functionalities, or make radical changes
  • it uses matchadd and pattern-based highlight, instead of matchaddpos and creating highlight by positions (much faster this way).
  • it works in a hybrid insert mode that I didn't understand, in a way that it will conflict with a lot of plugins, and doesn't allow autocomplete (because it quits insert mode after every keystroke I guess)
  • it doesn't allow you to move freely, pausing the multiple cursors mode, to add new cursors/words etc.
  • it's kind of slow for a combinations of the reasons above

I wanted something that could make use of modal editing and expand on it, rather than something that mimics Sublime Text's selection method, but with a lot of limitations, because vim isn't Sublime Text.

There was too much I wanted to change for trying to mess with an existing plugin, but there are probably situations that vim-multiple-cursors handles better, right now.

mg979 avatar May 21 '18 22:05 mg979

@mg979 thanks for the response. I would say that out of the 5 points you are raising, the only one that would potentially have to be discussed to be approved by vim-multiple-cursors is this one:

  • it works in a hybrid insert mode that I didn't understand, in a way that it will conflict with a lot of plugins, and doesn't allow autocomplete (because it quits insert mode after every keystroke I guess)

You seem to be very talented and I think this is too bad to keep those good ideas for a different plugin. There are a lot of user of vim-multiple-cursors and I think everyone could benefit from your contribution on this plugin.

I will try your plugin when I will be less busy (I'm getting married in 3 weeks 😄 ). If it's well done and there is a real paradigm difference compare to vim-multiple-cursors, we could add a reference to your plug-in in the README. If there is no different paradigm, I think you should create PR's to modify vim-multiple-cursors.

Cheers, Antoine

antoinemadec avatar May 22 '18 00:05 antoinemadec

Ok thanks! There is a whole lot of differences, but I guess some stuff could be ported to this plugin, if it can improve it.

mg979 avatar May 22 '18 00:05 mg979

I really want to this multiple-cursors and your plugin merged. multiple-cursors is easy to use, but fewer features, your plugin has more features, but too complex when not used hybrid insert mode.

ghost avatar Sep 08 '18 10:09 ghost

too complex when not used hybrid insert mode

@midnio What is that you find complex, and when exactly?

mg979 avatar Sep 08 '18 16:09 mg979

@midnio for the very basic cases vim-visual-multi is not even an iota more difficult than vim-multiple-cursors, you can configure exactly the same Ctrl-d shortcut and behavior will be the same (but faster and correct). You don't have to use more complicated features, but they are under your fingers if you ever need them. I see no point in merging anymore.

balta2ar avatar Sep 08 '18 17:09 balta2ar

@mg979 @balta2ar I really don't understand why those efforts aren't merged in vim-multiple-cursors. Is this for "I did this plugin not you" kind of reason, or is there an actual paradigm difference that the maintainer is against?

The nice features + performances of vim-visual-multi seem really interesting. I just don't understand the need to create a new repo.

*cries in Care Bears*

antoinemadec avatar Oct 04 '18 21:10 antoinemadec

@mg979 The plugin you created is insane! I've been using multiple-cursors for years, I came once again to the issues tab to seek for a workaround to the performance issues that recently became too big of a problem and guess what - I found one.

subev avatar Dec 26 '18 03:12 subev

This works so much better, at least for me. Thank you!

tbhockey avatar Nov 09 '19 12:11 tbhockey