On Thu, Jan 19, 2012 at 11:42 AM, David Brunell <quantal...@gmail.com> wrote:
> How long did it take you to get comfortable with paredit?  I keep getting
> frustrated and going back to manually matching parens.

I had the same experience for a while, but then I realized I just had
to remember 3 things:

To enclose an existing sexp inside a new one---in other words, if I
have (map...) and I want (doall (map...))---put the cursor on the
opening paren of the existing sexp and type M-( and it automatically
wraps the whole sexp in parens, correctly balanced.

To pull an existing sexp out of its enclosing sexp---i.e. to turn
(doall (map ...)) back into (map...)---put the cursor on the opening
paren of the inner sexp and type M-uparrow. Use with caution, because
it nukes anything else in the same enclosing sexp, but that's not too
bad because:

If you put the cursor on the opening paren and then hit C-k, it cuts
out exactly that sexp (and its contents) but no more, keeping the
parens perfectly balanced.

That last trick is what made paredit a must-have for me, because I do
a lot of cut and paste, and paredit makes it a piece of cake. You
don't have to worry about selecting the beginning and ending parens,
just put the cursor on the open paren and hit C-k, and it cuts exactly
as much as it needs to grab a balanced sexp, even across multiple
lines, leaving any other close-parens untouched. It's awesome.

I think paredit does other stuff too, but those three things get me
through the day.

Mark

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to