Fork me on GitHub
#emacs
<
2020-01-05
>
didibus02:01:53

To whoever suggested the combination of aggressive-parens-mode and adjust-parens! Thank you! It's a game changer for me

pizzaspin 4
4
dazld15:01:45

I remember this chat! we were talking about parinfer

dazld15:01:50

what’s your setup now?

dazld15:01:06

(not my suggestion re aggressive parens etc, was someone else)

dazld15:01:17

aggressive-indent and adjust-parens ?

didibus19:01:23

Ya pretty much, and I use smartparens as well.

didibus19:01:47

I tried parinfer before, but the problem is that it works 85% of the time. If you paste in some badly indented code, or checkout a codebase with bad indentation and open it with pareinfer, it will break the code because it will automatically recompute the parenthesis based on the indentation, and since the indent is wrong, it will do the wrong thing.

didibus19:01:23

It also frustrated me that with parinfer, I can no longer auto-indent.

didibus19:01:19

To remediate that, parinfer assumes you will switch between parens mode and indent mode accordingly. So like siwtch to parens mode before pasting, and then switch back to indent mode, for example.

didibus19:01:58

But this got tedious, and I'd always forget to do so. And then it has smart mode, but in Emacs, that's on a branch, and I didn't try it. They seem to think its not fully working yet. Smart mode is basically parinfer trying to auto switch between indent and parens mode for you. But there's so many things that can modify the buffer that it needs to hook into to be smart, that's why smart mode is hard to implement and get working with everything.

didibus19:01:22

Adjust-parens is like parinfer, but on demand and local to the form you call it on. By pressing TAB or S-TAB when the cursor is at the start of a form, you can basically alter the nesting of the form to its surrounding form. And aggressive-indent-mode means everything is always auto-indented in a smart way. So for example, if you backspace, instead of breaking indent, it will move the line up.

didibus19:01:42

Its really nice, like the best of parinfer and smartparent (which is same as paredit).

👍 4