(Perfect? Environment)

 
One of the most common combinations for Clojure development is Emacs and Leiningen project automation tool.

 Leiningen allows you to define your project using Clojure and includes dependency management (like Maven but nicer) as creates projects using structured templates for project files & folders.  Leiningen can also start the Clojure runtime enviornment, the REPL and load in your project automatically.  Emacs can connect to the Clojure (REPL) by connecting to an existing session or starting a new REPL session.  Emacs provides excellent syntax highlighting, parsing and inline documentation the clojure-mode plugin, auto-complete and paredit.  

Clojure is also available for many of the common tools such as Eclipse (CounterClockwise) and IntelliJ (LaClojure).  The best language support is usually found in Emacs, in part due to their shared evolution from Lisp. 

The easiest way to start with Emacs is to use the Emacs Live setup or you can follow the simple guide below if you want to understand how its all set up.

A basic Clojure environment
The following guide will help you set up an Emacs environment for Clojure development in 5 easy steps:



Alternatives to Emacs


Eclipse and Counterclockwise
If you are a Java developer and familiar with Eclipse then using the Counterclockwise plugin may help you with the learning curve.  Counterclockwise includes Leiningen 
Emacs Live - ready made setup

Sam Aaron has created a great clojure setup for Emacs, with colour matched parenthesis, auto-complete, undo-tree, nrepl & swank support and all the other goodies that make Emacs Clojure development fly.

1) Run the easy install script found on Emacs Live git repository:
 http://github.com/overtone/emacs-live

This script will move any existing ~/.emacs file, ~/.emacs.el file or ~/.emacs.d/ directory out of the way and create a new one fully loaded and configured

4) Once the script is complete, start Emacs.  You will see many messages and perhaps a few warnings, but Dont Panic!

5) If you are concerned about the warnings, restart Emacs and you should see a lot less


Add Leiningen 2 for Build & Project management

To get a complete Clojure environment, you should also install Leiningen 2 and configure it to include the REPL plugin in all projects. This enables you to run the REPL in emacs using M-x clojure-jack-in or for the newer nREPL use M-x nrepl-jack-in