zprint is a highly configurable code formatter and pretty-printing library for Clojure and ClojureScript. It can reformat source code, Clojure data structures and EDN expressions using a wide range of formatting conventions.
The program goes beyond correcting indentation. It examines the structure of expressions and determines how lists, vectors, maps, sets and other forms should be arranged to improve readability. Its formatting engine provides extensive control over line wrapping, spacing, alignment and the treatment of comments.
zprint offers predefined styles for common formatting preferences, allowing developers to change its behaviour without constructing complicated configurations. More demanding users can customise individual formatting rules or combine styles to produce their preferred layout.
The formatter can be used from the command line, within the Clojure REPL or as a library embedded in other applications.
This is free and open source software.
Key Features
- Reformats Clojure and ClojureScript source code and EDN data structures.
- Provides configurable formatting of lists, vectors, maps and sets.
- Supports predefined formatting styles for different coding conventions.
- Offers styles that preserve existing blank lines or newline positions.
- Includes an indentation-only style for minimally invasive formatting.
- Can apply community formatting conventions to Clojure source code.
- Provides configurable line widths, indentation and expression wrapping.
- Supports alignment and justification of map entries and other paired expressions.
- Offers specialised formatting for function definitions, bindings, conditionals and other Clojure forms.
- Can recognise and format Hiccup vectors using appropriate layout rules.
- Supports formatting and organisation of namespace declarations.
- Provides configurable sorting and alignment of namespace requirements and imports.
- Preserves or reformats comments and blank lines according to selected options.
- Supports syntax colouring for formatted output.
- Offers configurable formatting of tagged literals and reader conditional expressions.
- Can process multiple source files using file selection patterns.
- Provides a library API for integration with Clojure applications and interactive development environments.
- Cross-platform support – runs on Linux and macOS.
Website: github.com/kkinnear/zprint
Support:
Developer: Kim Kinnear
License: MIT License

zprint is written in Clojure. Learn Clojure with our recommended free books and free tutorials.
Related Software
| Clojure Code Formatters | |
|---|---|
| cljfmt | Tool for detecting and fixing formatting errors in Clojure code |
| Joker | Small Clojure interpreter, linter and formatter |
| zprint | Reformat Clojure and Clojurescript source code |
| cljstyle | Supports several different commands for checking source files. |
| Standard Clojure Style | JavaScript implementation of a formatter for Clojure source code |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.