abo-abo / lispy

Short and sweet LISP editing
http://oremacs.com/lispy/
1.19k stars 129 forks source link

lispy in spacemacs #122

Open drorbemet opened 8 years ago

drorbemet commented 8 years ago

I am thinking about moving from prelude config to spacemacs. Is there anything I should be aware of using lispy with the clojure-layer in spacemacs?

Some notes regarding the context of my question: I am very impressed by how far lispy got to consolidate commands for structural editing lisps.

Still I and some other people on github too (I searched the notes in sources of config files) ask themselves how to consolidate paredit, smartparens, paxedit, refactor.el and lispy (kind of once and for all ... ). https://github.com/search?utf8=%E2%9C%93&q=paxedit+vs+lispy&type=Code&ref=searchresults

refactor.el seems to cover some structural editing operations too, making lispy less relevant for clojure development?

The question actually seems to be how to extend lispy with other commands if needed. Until now I hope that the evil keybinding system will help me to integrate lispy with other related commands into one seamless interface and workflow. Is this a real need or does it just seem to be a need from beginners perspective?

Here are some entry points on this topic: https://github.com/syl20bnr/spacemacs/pull/2792 https://github.com/search?q=evil+lispy&ref=opensearch

abo-abo commented 8 years ago

The question actually seems to be how to extend lispy with other commands if needed.

If you need other commands, let me know. If they're useful I'd be happy to add/implement them.

Is this a real need or does it just seem to be a need from beginners perspective?

The way I use Lispy, I don't find it lacking anywhere. Initially, I went through all of Paredit functionality to make sure that Lispy offers an equivalent of it. Smartparens doesn't do more than Paredit for LISP, as far as I know. I did have a look at Paxedit when it was just released, Lispy has the same functionality in a consistent way.

I don't know to which refactor.el you refer. But I'm aware of clj-refactor. I've never used it seriously, but I've examined it and it's a completely different way of approaching things than Lispy. Instead of having very accessible basic commands from which you build your refactor dynamically, clj-refactor (and similar packages, I guess) gives a huge list of canned recipes, that apply only in specific situations and can't be composed. The way I see it, in a perfect situation the canned recipe is always faster (just once shortcut to do everything), but it takes effort to remember all recipes and recognize which one to use. On the other hand, with lispy you incrementally transform your code by composing familiar commands that you use over and over: sometimes it's more key strokes, but it works in all situations. Still, there's no issue in using at once two orthogonal packages like lispy and clj-refactor: in each case you can take the clj-refactor shortcut if you recognize and remember it, or use lispy instead.

cmccloud commented 8 years ago

I started writing the spacemacs lispy layer with the initial thought that it would take a bit of work integrating it with evil. The more time I spent using lispy, the fewer changes I found I needed to make against the stock configuration. I use lispy together with clj-refactor in basically the way that abo-abo describes - lispy is how I do 95% of my work, and I'll dip into the clj-refactor commands directly when it's convenient.

There are maybe 2 or 3 keybindings that need to be tweaked in order to get lispy up with spacemacs - you want to be able to access the evil-leader key prefix (M-m in emacs mode), the evil-leader-mode-prefix (C-M-m) and maybe the evil-jumper forward and back commands (TAB and C-o) depending on how often you use them.

On extending lispy commands, I had asked a similar question here https://github.com/abo-abo/lispy/issues/111 and abo-abo's answer was exactly what I was looking for.

Since a few people have mentioned it in the last couple of days, I'll go ahead and make a new lispy layer for getting started using it in spacemacs.

drorbemet commented 8 years ago

Thank's a lot now I have the confidence to learn lispy thoroughly and to rely on it in the future. I will continue to post questions regarding workflow and bugs.

Reefersleep commented 8 years ago

As an enthusiastic Emacs newbie and seasoned Vim user who's eager to get into sexp-level editing with sensible keymappings, I'm very much looking forward to your lispy spacemacs layer, cmccloud!

ryepesg commented 8 years ago

Great to see Lispy integrated with Spacemacs/Evil. I see @cmccloud is also a commiter to https://github.com/luxbock/evil-cleverparens, how are the projects related?

drorbemet commented 8 years ago

https://github.com/luxbock/evil-cleverparens/issues/34

ryepesg commented 8 years ago

https://github.com/syl20bnr/spacemacs/pull/4596

Reefersleep commented 8 years ago

Fantastic :D

timofeytt commented 7 years ago

@abo-abo Shortcuts are meant to be mnemonic. Also, with Spacemacs you can discover them easily. In the case of clj-refactor in the Clojure layer I don't need to remember the function I'm trying to perform. If I'm trying to do an extraction, then I go into the (e)xtract menu which gives me options for the task I'm trying to perform.