# CLJ Commons: Building a formatter like gofmt for Clojure

**URL:** https://clojureverse.org/t/clj-commons-building-a-formatter-like-gofmt-for-clojure/3240
**Category:** Community Building
**Created:** [November 26, 2018, 12:31am UTC](https://clojureverse.org/t/clj-commons-building-a-formatter-like-gofmt-for-clojure/3240 "2018-11-26T00:31:12Z")
**Posts on this page:** 1
**Showing post:** 37

<div class="post-metadata">

### Author: ![PEZ](https://clojureverse.org/user_avatar/clojureverse.org/pez/32/1187_2.png) [@PEZ](https://clojureverse.org/u/PEZ)
#### Post date: [November 30, 2018, 7:39am UTC](https://clojureverse.org/t/clj-commons-building-a-formatter-like-gofmt-for-clojure/3240/37 "2018-11-30T07:39:19Z")

</div>

> [@kkinnear](#):
>
> If there are other things it can’t do, I’d be more than happy to look into enhancing it.

I tried to use `zprint` in Calva Formatter but had to give up on trying to behave like I needed it to behave. I mentioned it in [this thread](https://v2.clojureverse.org/t/i-need-some-zprint-config-examples/3121), which asked for ways to make zprint to not alter newlines. It could be that zprint can meet my format-as-you-type requirements, and I just haven’t found out how. I also mentioned in earlier in this thread that I think a formatter that should support the editor use cases need to be able to consider the cursor position and the selection before and after reformatting the text. For perfomance reasons I would also wish for a way to ask zprint to only format a given range of the code as well as a ”minimal” range from the cursor.

I mentioned a few other things that the editor use cases need, early in the thread. If zprint can be made to support being used by the editors while code is being edited, I would say it is definitely a way to implement this Commons formatter, that should be considered.

---

_[View the full topic](https://clojureverse.org/t/clj-commons-building-a-formatter-like-gofmt-for-clojure/3240)._
