Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPIC] Usability changes for multiple cursors functionality #11130

Closed
wants to merge 1 commit into from

Conversation

sdwolfz
Copy link
Contributor

@sdwolfz sdwolfz commented Aug 4, 2018

Improvements made to multiple cursors support:

  • New keybindings C-M-j and C-M-k for easier cursor creation while editing (inspired from sublime)
  • Functionality extracted into a separate layer, installed by default in the .spacemacs.template
  • Allow multiple backends (currently evil-mc is implemented).

Planning next:

  • A transient state to help with complex operations.
  • Create cursors from visual selection
  • Quickly restore cursors once canceled

This is a WIP, many more goodies to come...

Changes already cherry-picked:

  • b2fbd7c - Encapsulates multiple cursors functionality in a layer
  • ad6ab57 - Renames the multiple cursors paste functions
  • f94b51d - Documentation for multiple cursors
  • c5a5ee3 - Document sublime inspired keybindings

@sdwolfz sdwolfz added the WIP Work In Progress label Aug 4, 2018
@sdwolfz sdwolfz self-assigned this Aug 4, 2018
;;
;;; License: GPLv3

(defun spacemacs//paste-transient-state-p ()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this function to spacemacs//evil-mc-paste-transient-state-p. The current name is too broad.

@syl20bnr
Copy link
Owner

syl20bnr commented Aug 7, 2018

Great initiative!

Do you think we can achieve to lazy-load it ?

I see that you prepared the ground for supporting several multiple cursor backends. I'm not sure this is really possible to support Magnar's multiple cursors or if it even makes sense to do it.
Spacemacs needs evil even for Emacs style. If users choose the barebone Spacemacs without Evil then they can install Magnar's MC themselves.

We can work to bring all the goodies (essentially some handy key bindings) from Magnar's MC to our layer based on evil-mc.

On my side I'll try to make evil-escape work with it, if I cannot make it then we will have to disable it as we do with the paste transient state.

@sdwolfz
Copy link
Contributor Author

sdwolfz commented Aug 31, 2018

I am not yet sure about removing backends and focusing only on evil-mc, but I requested feedback from multiple people before starting this and there seemed to be a lot of demand for having that.

It's going to take me a lot of time to finish this, so I will start integrating small changes directly and use this PR as an epic to track my progress.

@robbyoconnor
Copy link
Contributor

I wanna learn how to use this so bad

@sdwolfz
Copy link
Contributor Author

sdwolfz commented Aug 31, 2018

@robbyoconnor You can use the current functionality by enabling evil-mc with:

(global-evil-mc-mode 1)

Then you have all the keybindings under g r (no SPC, just those two).

What I've done so far was to add 2 more keybindings, the rest is just moving code from one place to another. Hopefully I can put some time aside this weekend to add more stuff.

@sdwolfz sdwolfz force-pushed the usability/multiple-cursors-layer branch from f934a52 to c902cc7 Compare September 3, 2018 20:35
;;
;;; License: GPLv3

(defun spacemacs//evil-mc-paste-transient-state-p ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the double slash // a typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is equivalent to -- which denotes a function is "private" and should not be used in other files, or relied upon to have a stable API, or still exist in the future.

@sdwolfz sdwolfz force-pushed the usability/multiple-cursors-layer branch 3 times, most recently from 39eba62 to a128cef Compare October 27, 2018 10:42
@sdwolfz sdwolfz closed this Oct 27, 2018
@sdwolfz sdwolfz deleted the usability/multiple-cursors-layer branch October 27, 2018 11:14
@sdwolfz sdwolfz reopened this Oct 27, 2018
@sdwolfz sdwolfz restored the usability/multiple-cursors-layer branch October 27, 2018 11:15
@sdwolfz sdwolfz force-pushed the usability/multiple-cursors-layer branch 4 times, most recently from bfb6ea5 to cd2b7de Compare October 27, 2018 11:43
@sdwolfz sdwolfz force-pushed the usability/multiple-cursors-layer branch from cd2b7de to f95f8ad Compare October 27, 2018 11:53
@sdwolfz sdwolfz changed the title Usability changes for multiple cursors functionality [EPIC] Usability changes for multiple cursors functionality Oct 27, 2018
@bet4it
Copy link
Contributor

bet4it commented Oct 28, 2018

Argument of interactive in spacemacs/evil-mc-paste-before and spacemacs/evil-mc-paste-after is wrong.
More details in #11340.

@deb0ch
Copy link
Contributor

deb0ch commented Oct 29, 2018

Hey, I would like to start playing around with this (and maybe even, why not, participate to the effort) but can't find your commits anywhere, they seem to be all gone since you deleted the branch adn replaced the commits with this placeholder.

Where are they ?

@sdwolfz
Copy link
Contributor Author

sdwolfz commented Oct 29, 2018

@duianto @bet4it I saw your comments and PRs and will deal with the issues soon.

@deb0ch The commits are already cherry-picked into develop, see the main post for a refference to them. I want to keep this PR active to more easily test out stuff, that's why you can only see the placeholder commit.

@deb0ch
Copy link
Contributor

deb0ch commented Oct 30, 2018

@sdwolfz Omg, I actually tried to look in develop if they were not there but somehow managed to not see them 😅 Wonder what went on in my head

@sdwolfz
Copy link
Contributor Author

sdwolfz commented Jun 7, 2019

Closing this as I'm not actively working on it, and I won't be able to in the near future.

@sdwolfz sdwolfz closed this Jun 7, 2019
@sdwolfz sdwolfz deleted the usability/multiple-cursors-layer branch June 7, 2019 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awesome 💜 WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants