I think paredit is one of the best arguments for simple sexp style syntax. It allows you to build easily comprehensible tools that manipulate code on syntactic rather than textual level. Its definitely possible to build the same kind of tools for more complex syntaxes, but its harder for users to understand and use those tools.
It's quite surprising to see something I wrote turn up here.
When I first started with Paredit I struggled to absorb the functions and key bindings from the manual and cheat sheets well enough so that I could use them while writing code. I know that seeing them in action would have helped me a lot, so I made this and put it out there, I really hope that it can help other people to start using more of Paredit.
This will let your fn key (which if you're clever you've defined as 'hyper', though it doesn't matter here) + arrow keys work for the fundamental paredit commands.
I've read comparisons between smartparens and paredit, but I haven't found the case for smartparens compelling enough to switch. Are there any features in smartparens that paredit lacks that you feel you can't live with out, or make your life easier?
Smartparens is actively maintained, which for me is an attractive "feature" when evaluating any tool that is to find a prominent place in my workflow. Also, its extensible design allows it to be used with languages and data formats other than lisp/scheme dialects, so it has a broader reach than paredit.
As for wrangling sexprs in, say, Clojure, I think paredit and smartparens are one equal footing. I still stand by my original statement inasmuch as I think smartparens is a worthy successor to paredit.
I haven't yet, but I intend to when I get some time. I was hoping to find someone else to give me an opinion on how it compared to paredit and smartparens, before I tried it out :)
I've been using paredit with my clojure for a while now and I really love it. But how do I get those multi coloured matched brackets? I've seen them on others screenshots too, but I don't know which mode enables them in my emacs.
Also, I've found with paredit that it keeps the brackets balanced until I paste in a segment of lisp with unmatched brackets. Then it gets in a bind and I need to either disable paredit to manually fix it, or go into overwrite mode to fix it. Is there any graceful way to deal with bad bracket-unmatched code pasting in paredit?
As for the unbalanced delimiters, I just M-x paredit-mode, turn it off, make my fixes (which is easy because rainbow delimiters shows me exactly which delimiter is out of place), and then turn it back on again.
An easier way to deal with unbalanced delimiters without toggling paredit-mode is to use C-q, quoted-insert. C-q ) inserts a literal ) where regular ) is bound to paredit-close-round.
Quoted insert is generally useful when you want to enter a specific character that is bound to something other than self-insert, such as a literal newline in a regex pattern.
Yep, C-q is also useful when you need to comment out part of a multiline sexp without doing a block select and C-;
Otherwise paredit will helpfully move the comment to a newline to avoid breaking the balance ;)
For the bonus, paredit-convolute-sexp is useful exactly for the case they show, moving a binding/wrapping form some levels up. It saves a lot of keystrokes when you're in that situation.