syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

I want to help to get lispy into spacemacs. What should I work on? #6050

Closed mikavilpas closed 4 years ago

mikavilpas commented 8 years ago

Hey guys, I'd like to put in work that would enable spacemacs users to use lispy. I see there has been some work already on this:

But it seems to me that both those efforts have stalled for the time being.

I've worked on the evil-lispy package, which provides an opinionated way of using evil with lispy. It aims for simplicity for evil users - see the readme for more. I have a private layer set up for it in my own config, but I don't think it's ready for inclusion in spacemacs yet.


For this purpose I'd like to open a discussion. Please tell me what you think about this, and what I should work on. I think spacemacs and lispy are great, and would love to see them work together in an idiomatic way :+1:

nixmaniack commented 8 years ago

Just my 2 cents.

I am already using lispy with spacemacs while using hybrid style. As an active user of both spacemacs and lispy, I would just like to have lispy as is in hybrid state without any modifications except having M-m on something else.

You should go through the discussion of the first thread you pointed as in the end syl20bnr had expressed what he's expecting to include with lispy.

mikavilpas commented 8 years ago

Fair enough. That should be totally doable: hybrid state would need no modifications, possibly.

sooheon commented 8 years ago

I would just like to have lispy as is in hybrid state without any modifications except having M-m on something else.

This is how I use it currently as well, along with lispyville. I don't think lispy really needs a layer that much, it works pretty much as you'd expect, going into special in insert mode and staying out in normal mode. Probably the most important config should be done by end user (personal keybinds, etc.)

randre03 commented 8 years ago

@sp3ctum I'm curious how this is going? I am an evil user that wants to use lispy in spacemacs and am not interested in having to temp. switch to hybrid style to do so. About your private layer you mentioned, do you use that with the stock clojure layer as well? Thanks

sooheon commented 8 years ago

I think this is an antipattern. You don't need another mode for lispy, just use insert (or hybrid), it doesn't matter. I've been doing it this way without any special customizations for a while now, it's far better than toggling using M-m k or whatever else. An insert command like I or A is usually all it takes to get into special, from where you can move around using all the lispy commands directly, and esc takes you to normal state, just like vanilla evil. 99% of the time after I/i/A/a I'm immediately in special state, the other 1% of the time, I do have to press C-M-f or C-M-b once.

mikavilpas commented 8 years ago

@randre03 Unfortunately I haven't worked on this since my last messages. I kind of settled on using my own layer, and am wondering, much like @sooheon, whether spacemacs users would find this a useful addition or not. It probably doesn't handle all use cases (only evil mode), and I think it's likely that it doesn't provide a lot of extra value for many.

However, I do use it personally all the time (for me it's nice at least). I use it with emacs lisp and with clojure, and both work very well.

Any thoughts?

sondr3 commented 8 years ago

Do you guys have your private layer/dotfiles anywhere so I can look around for how you configured it? I'm almost considering ripping out the Scheme layer and replace it with my own version using Lispy.

mikavilpas commented 8 years ago

Yeah, mine is in the same repo as the private layer, see the original post.

sondr3 commented 8 years ago

Ah, completely overlooked that, thanks.

Somelauw commented 7 years ago

Maybe lispyville can be added to spacemacs. It's a plugin similar to evil-cleverparens, but backed by lispy. Including it in spacemacs, should also make lispy itself available.

lane-s commented 6 years ago

Based on the old lispy layer thread, it looks like we need the lispy layer to, by default, act like a replacement for evil-lisp-state. I think the layer that @sp3ctum created works great, but I understand wanting have consistency with the SPC k sexp editing functions. Sometime soon I will try to see if I can make a layer that replaces evil-lisp-state with evil-lispy state and has appropriate key bindings in the SPC k menu. I would also want to add a configuration variable that just makes SPC k enter evil-lispy-mode.

I was not able to get lispyville working in spacemacs, so I'm leaning towards using evil-lispy-mode.

Somelauw commented 6 years ago

I personally don't have interest in an evil-lispy-state, but prefer to use it in insert state or in a lispyville way. But if you are going to make a replacement for evil-lisp-state using lispy, I think it would be better to put it in a separate repo, so it can also be used by non-spacemacs users.

By the way as I have mentioned before I think a lispyville layer (similar to cleverparens) would be a good way to expose lispy to Spacemacs users. All it takes for a user in that case is to enable lispy to get lispy in insert mode if they want it.

lane-s commented 6 years ago

@Somelauw could you elaborate further on what you mean by 'using it in insert state or in a lispyville way'?

The evil-lispy-mode package from @sp3ctum already has an evil-lispy-state, which basically toggles on lispy bindings. You have to press escape to get out of it, just like evil-lisp-state.

As far as I know, the only reason that his layer wouldn't be added to spacemacs right now is that it does not replace the SPC k bindings with sensible alternatives. Instead, it adds a minor mode (evil-lispy-mode) where there are a few keys you can press to do some movement and then enter a lispy editing mode until you press escape.

edit: I would probably also rebind some lispy commands and maybe change some of the functionality to be more vim-like. I need to get some more practice using lispy and writing lisp in general, but there were a few things that felt wrong to me as an evil user.

Off the top of my head:

I'm also put off by the way that editing atoms works in lispy. I think I would prefer if selecting an atom gave me the option to switch the point from one end of the atom to the other but also use evil commands such as cw or cfx. There could also be lispy specific targets like in lispyville, so you could do things like ca 'change atom' or da 'delete atom'. After making the edit, escape would take me back to lispy state with the atom selected.

I think some kind of lispy state could be an excellent replacement for evil-lisp-state, it just needs more work to make it more intuitive for evil users.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!