Fork me on GitHub

For those using vim-parinfer, how have you dealt with parinfer’s automatic reformatting of existing files that are not indented in a way that parinfer expects?


An easy example is the clojure-koan files; in some cases it’s been completely impossible to indent to the desired level of paren nesting.


i accept the reformatting as gospel and check the changes into source control 🙂


it's not always doable, depending on the dynamics of your team. some people might find it annoying to have their code reformatted


i usually give the old "i can't help it, parinfer reformats my code automatically ¯\(ツ)/¯" excuse


so far i haven't really run into any resistance on my team. i don't think they care all that much about formatting


I think parlinter enforces reasonable formatting tbh


yeah, i like it


one place it can get a little weird is if you open a file where somebody has commented out the final expression in a form, and they wanted it to be easy to comment/uncomment it, so they did something like this:

  (foo 1 2 3)
  (bar 2 3 4)
  ;; (baz 3 4 5)
(note the trailing paren on its own line)


parinfer will reformat that as:

  (foo 1 2 3)
  (bar 2 3 4))
  ;; (baz 3 4 5))


which works fine for parinfer users, but a non-parinfer user will end up with mismatched parens when they uncomment that line


unless they have some other plugin that corrects the parens, i guess


The problem I’ve experienced is when existing indentation results in forms being completely rewritten, so I then have to figure out how every line is supposed to be indented to return the parens to their original positions.


That bit me hard when I had to figure out why every function in a file suddenly stopped working.