Hacker News new | ask | show | jobs
by wink 523 days ago
Not your fault, but I think it's such a silly argument.

About 90% of my problems arise when I shift the parens, e.g. going from `(+ (1 2))` to `(+ (+ 1 2) 3)` or the other way round - and if there is now ) or )) at the very end (but more likely at 4+, not 1 or 2.

How would any plugin know what I mean here? (I know + is a bad example as its commutative...).

2 comments

Paredit has lots of great ways to do that sort of thing, though, while keeping things balanced. In emacs with paredit, providing a prefix argument to open paren lets you surround n sexps in the new parens. There's also slurp and barf to move sexps in and out of parens.

Editing for lisp mirrors the language as a whole in that there's a learning curve, but once you've climbed it, it's a joy to work with. Because the syntax is so uniform, all you need is a handful of extensions/commands for full blown structural editing.

I get by splendidly in emacs with nothing but paredit and convenient keybindings(not a huge fan of paredit defaults).

You need to clarify your example, because it appears that you are inserting `+` and `3` between existing parens rather than shifting them.

But regardless, I think the answer you are looking for is:

Some of the coolest kids of all use rainbow delimiters so that they can easily identify the matching closing paren with their eyes!

I tried, I'd need to crank the font size up to 14+ to discern the difference ;)