catnip icon indicating copy to clipboard operation
catnip copied to clipboard

paredit-like sexp editing in catnip, please!

Open alexbbrown opened this issue 13 years ago • 4 comments

When using emacs for development, the lovely paredit allows brackets to be placed and moved efficiently, and prevents para-breaking edits from happening.

http://emacswiki.org/emacs/PareditCheatsheet

I would love to see this in catnip. Catnip already supports some bracket shortcuts:

(: "" -> () [: "" -> [] {: "" -> {}

But paredit can do more:

alt-( : a -> (a) ctrl-( : (a) b -> (a b) alt-s : (a b (c)) -> a b (c) alt-d : (a b) -> (b) ((a) b) -> (() b)

and so on.

alexbbrown avatar Dec 13 '12 16:12 alexbbrown

This is the single most requested feature - from myself as well, so I guess this is coming in the near future. :)

bodil avatar Dec 13 '12 16:12 bodil

+1

I've got a paredit-forward-slurp kinda working : (a) b -> (a b) - It uses a lot of fairly clunky cursor tricks to achieve it though, which I'm not entirely happy with. I'd prefer it working from some kind of AST instead, pulling in the next available form logically instead of by characters.. anyhow.

CmdrDats avatar Jan 09 '13 13:01 CmdrDats

I'm pretty sure https://github.com/laurentpetit/paredit.clj can be gainfully employed to implement paredit style editing - it could even be ported to Clojurescript without much trouble, but even on the server side it'd be a lot better than reimplementing.

bodil avatar Jan 09 '13 15:01 bodil

Good point - I'll look into implementing paredit.clj on the server side for now till the cljs branch is developed more :) The roundtrip shouldn't render it unusable

CmdrDats avatar Jan 10 '13 09:01 CmdrDats