Hacker News new | ask | show | jobs
by meken 12 days ago
> I do wish there were an easier way to move in the ]}]})))}-ness of block ends though.

I’m not quite sure what this means. How is it different/worse than all parens..?

fyi I use paredit and just hit ) and it moves me past any kind of paren/bracket. But even without that you can just hit left and right..?

3 comments

They are a pain if they get unbalanced if you aren’t using paredit. Like if I vi delete the last line of a function out of habit it’s a pain to get them back in the right order.

It’s easier if everything is parens, just hit paren til the errors are gone.

Ah I see. That makes sense.

That’s making me really thankful to be a paredit user.

Learning paredit is on my list of things to do.

I've been loving Clojure for hobby projects lately but my editing setup sucks for Clojure. The vi commands I'm used to using are bad in Clojure (eg copying by line almost always means unbalanced parens), and the autocomplete LLMs are very inconsistent about closing syntax correctly.

It seems super cool, I just haven't done it enough for my brain to reach for paredit keybinds instead of vim chords.

I use Emacs's built-in structural editing bindings, which doesn't have the auto-move-past any kind of paren/bracket thing. Maybe I could add that in.

But I was talking about like, when refactoring, I'll maybe change something from a list to a vector, and I have to change the delimiters at front and back. Or, where electric-pair does do the move-past-all-parens thing when I just spam ), it doesn't do that with ]}]}]]}}]})).

I don't recall the exact name, but I believe it's forward-up-sexp which allows you to jump forward past the next closing delimiter. Though if I'm not mistaken only the backwards one has a default binding.
I see.

Have you ever tried paredit? It’s pretty much a lifesaver for this kind of thing.

Exactly. Paredit for the win.