-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add evil-cleverparens layer #2747
Conversation
👍 |
Though I think it belongs in the spacemacs layer personally |
With sp strict mode enabled, D is deleting more than a single sexp here, are you seeing the same behavior? |
Can you give an example?
|
With evil, smart-parens, smart-parens-strict, and evil-smartparens enabled in an emacs-lisp buffer
My expectation is that "D" should delete sexp-A and it's child, but leave sexp-B and sexp-C, instead D results in:
|
I see the same thing, and I would have the same expectation. Maybe you can On Tue, Aug 25, 2015 at 2:25 PM, Christopher McCloud <
|
I want to see if it's a spacemacs thing before I do that, but if I replicate this consistently then yes, I will. |
It's not. Here is the problematic function: https://github.com/expez/evil-smartparens/blob/master/evil-smartparens.el#L86 |
Thanks @justbur, nice catch. |
I don't know much about this package. It just seemed like a good idea, and On Tue, Aug 25, 2015 at 2:41 PM, Christopher McCloud <
|
I also wonder if we should take a look at lispy, which I believe has a fair amount of overlap to this package. I have been meaning to write a configuration layer for it for a while, but just haven't found the time. It does bring up the question of which of the many lisp editing packages should be included in spacemacs. I believe there is even some overlap already implemented for editing sexps. Just something to think about. |
I don't see anything wrong with having a layer, like lispy, that replaces This one works joins evil and smartparens which are both included by On Tue, Aug 25, 2015 at 3:06 PM, Devagamster notifications@github.com
|
I suppose having more options is good :) |
@Devagamster for what it's worth i added a really basic layer for lispy that you might use as a starting point. I've basically added lispy conditionally to evil-emacs mode since there are many buffers which use evil-emacs where lispy is inappropriate. Initially I thought to model a lispy layer after the built in lisp-state, but after using it more I didn't think it warranted an additional state. https://github.com/cmccloud/.spacemacs.d/blob/master/layers/lispy/packages.el |
Interesting comment on the bug report. @cmccloud what do you think of https://github.com/luxbock/evil-cleverparens? I wasn't aware of it |
I'll take a look, it actually sounds incredible (as did/does evil-smartparens). If the thought is that one of these packages might end up in spacemacs by default, I do think it makes more sense to pick the one that comforms as closely as possible to sp or evil behavior. Even if a greedy "D" is useful, I don't want to add more for new users (and new lispers) to have to keep track of. Edit: Along those same lines, I think it would be good to hear from spacemacs users new to lisp generally before setting any kind of structured editing mode as a default. |
I agree with you that the default behavior for "D" is unusual. Why don't On Tue, Aug 25, 2015 at 3:31 PM, Christopher McCloud <
|
@cmccloud I don't like the behavior of "D" in your example with cleverparens either. |
@justbur you think it should clean-up afterwards? |
I liked your suggestion for the case you pointed out, but at least the On Tue, Aug 25, 2015 at 4:34 PM, Christopher McCloud <
|
sorry, what behavior are you seeing with cleverparens, using my example from earlier? |
Oh that it just deletes the line leaving an unbalanced expression.
|
I see exactly what I expected from my earlier example - identical to what calling sp-kill-sexp produces. |
That's weird. It worked for me the second time. |
@cmccloud Switched the pr to cleverparens. I like the movement commands it adds too |
you squashed the commits and everything. good man |
or women... |
@justbur I really like cleverparens too - I've encountered a few bugs, but overall I think it's great. |
I've got an opened issue for evil-cleverparens that hasn't had a response in a while. |
@Devagamster and @cmccloud I'm also using lispy (and other abo-abo packages) extensively, and I've been overriding a lot of spacemacs with it. I'd be happy to contribute to a layer as well. |
I really like the idea of some minimal changes to evil to make it respect On Thu, Aug 27, 2015 at 11:26 AM, Sooheon Kim notifications@github.com
|
I agree, it's very much in the spirit of spacemacs. Just wish the package was maintained, but I also agree we could maintain a fork as well. |
@sooheon Do you have an opinion on evil-smartparens? That's what we started with here |
@cmccloud I think the function you wanted for your original example is |
@justbur For than the |
@sooheon If you're willing to share what you've got so far, I would like to take a look at what you've put together so far with lispy. Maybe we can open a new PR for a lispy layer and whoever is interested can start to contribute. What I really like about evil-cleverparens is that it's robust enough to work as someones primary structured editing tool, and at the same time the changes it introduces are subtle enough that it doesn't get in the way otherwise. I could imagine it being enabled by default without upsetting anyone. @sooheon @luxbock has made some contributions to spacemacs, so maybe we can get a hold of them and see if they would be willing to make a few changes for us. |
Thanks @sooheon. The author of evil-smartparens said something like he In the D example above for instance, maybe we should just make a layer On 8/27/15, Sooheon Kim notifications@github.com wrote:
|
I think that would at least be very clear what its trying to be, and useful. It should probably have a different name though. parevil? evil-parens? |
yes, different than any existing package. Whatever you guys what is fine I'll work on updating the pr. Just propose commands as you find them, and I On Thu, Aug 27, 2015 at 1:11 PM, Sooheon Kim notifications@github.com
|
I'd he happy to see EDIT: I think I've fixed the behavior of @justbur for ideal evil integration just replacing the binding of a key in normal-state isn't enough, as then you lose out on features like custom yank-handlers. I find it really handy to be able to use |
@luxbock I realized quickly yesterday that I would need to understand evil operators better to do this, so I'm happy to stick with cleverparens if you're willing to stay on top of any issues that come up. |
The biggest issue right now are quoted lists and unbalanced delimiters inside comments/strings which sometimes cause issues. I remember taking a look at this earlier without being able to come up with a fix but I'll give it another try today. There are some other bugs as well which I'm aware of (with |
I believe most of the issues raised here should now be fixed, and I've also added a few more features as well! I still have to update the README as it's quite outdated at this point. |
I believe the default If this PR is meant to fix this, then 👍 |
@justbur You have to rebase your README on top of the template, TheBB did some changes for the online documentation. |
👍 |
Thank you 👍 |
@syl20bnr I've tried to make all features that some might consider intrusive to be optional, but right now some of the defaults might be surprising to some who expects the bare minimum. For example there is a special version of Like I said earlier I'm quite open to making changes here and there if the community feels strongly about any aspect of the package, so feel free to drop issues and concerns my way. |
Seems like a nice package. See https://github.com/expez/evil-smartparens
Thought I'd add it as a layer before possibly adding it to the spacemacs layer.