That third trick works in standard vim when you type "da("...except you
don't have to be on the opening paren, you can be anyplace within the sexp
(as long as you're not within a smaller sexp, in which case you'll get that
one.)

A couple quick macros can handle the other two. If those three are the main
benefits of paredit, then vim might be a better fit for lisp than I'd
realized. (I'm a lispy newb so I don't have a whole lot of experience
trying to edit it yet.)

On Thu, Jan 19, 2012 at 8:26 PM, Mark Nutter <manutte...@gmail.com> wrote:

> 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
>

-- 
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