__[Try it online](
Last updated a year ago by shaunlebron .
MIT · Original npm · Tarball · package.json
$ cnpm install parindent 
SYNC missed versions from official npm registry.


Try it online

WIP public prototype— Indent Clojure files based on the following discussions:

Current Rules

  1. ALLOW - 1-space, 2-space, or Arg-alignment (user preference determined by first sibling line)
  2. ENFORCE - vertically aligned sibling lines
  3. ENFORCE - indentation after a paren should imply containment


Staggered indentation of siblings not allowed:

-    bar
+  bar

-    qux)
+    qux)

Cannot indent past an open-paren unless contained inside it (Parinfer):

 (defn foo
  ([a b]
-    (+ a b))
+  (+ a b))
  ([a b c]
-    (+ a b c)))
+  (+ a b c)))


npm install -g parindent

Try it

To indent all your files in place, run from your project root:

parindent '**/*.{clj,cljs,cljc}' --write


$ parindent

Usage: parindent [opts] [filename ...]

A minimal indenter for Lisp code (e.g. Clojure)

Available options:
  --write                  Edit the file in-place. (Beware!)
  --list-different or -l   Print filenames of files that are different from Parindent formatting.
  --stdin                  Read input from stdin.
  --version or -v          Print Parindent version.

Current Tags

  • 0.2.0                                ...           latest (a year ago)

2 Versions

  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2017 © |