Fork me on GitHub

My dear colleagues are unfortunately stuck using Emacs, and they're using clojure-mode to format their code. This brings some friction as whatever I'm using to format Clojure in Vim has enough differences to create whitespace diffs all the time. Especially in namespace requires etc.


Is there a vim plugin that deals with Clojure formatting in a way pretty similar to Emacs? I'm happy to have it even as a pre-commit hook or a on-save hook that runs things through an external process.


my gordian knot solution to this stuff is to use fugitive to highlight diffs and not check in whitespace only changes this can be done without editor tooling via git add -p to fix changes interactively in the terminal


in general treating the diff of any given commit as a thing you have signed your name on and making it as small and pretty and meaningful as possible goes a long way :D

❤️ 2

Oh for sure! I found out about chunks when git came out and it was a game changer. I use it as a pre-review round. But this file is very long and sifting through it is tedious.

nbardiuk12:08:41 has a lot flexibility. I am not sure if you can make it format code exactly as emacs but I would start there.


There's also zprint 🙂

☝️ 8

Perhaps I should be asking this to the Emacs channel 🙂 I think Vim is flexible here, as I can always pipe the contents of the buffer through an external program if needed.

Noah Bogart19:08:10

You can also bind a command, so :Format calls out to an external program for example


Which supports both zprint and cljstyle


external tools are the way to go, because you can also integrate them into things like CI


I've used zprint in "indent only" mode successfully in the past. But ideally whatever I'm already using to format code would be closer to what Emacs is doing. I'm curious if anyone has experience collaborating with Emacs users without this kind of trouble?


Is anyone using nvim + iced + reveal?


Got it. For anyone looking: iced repl --middleware=vlaaad.reveal.nrepl/middleware

👍 2