This gist will guide you to setting up a basic emacs-starter-kit-based Emacs configuration for editing Clojure.
The first step is to get Emacs. Whatever you do, just make sure you get Emacs 24.
To paraphrase Install the right Emacs:
-
On a Mac? Also see note for Mac users.
$ brew install emacs --cocoa
-
On Linux?
$ your-package-manager install emacs
-
On Windows?
- Download the latest version of emacs from http://ftp.gnu.org/pub/gnu/emacs/windows/.
- Follow the rest of the instructions on Install the right Emacs.
Once you've installed Emacs verify you have the correct version with emacs --version
▸ emacs --version
GNU Emacs 24.2.1
Copyright (C) 2012 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Now, for the config...
Prerequisite: Install Leiningen. Installation instructions.
To follow along with the contents of the presentation I would suggest you download and install the Emacs configuration bundled in this gist like so:
-
Clean out any existing Emacs configurations you have.
-
Clone this gist to your
~/.emacs.d
folder with the command$ git clone https://gist.github.com/5126926.git ~/.emacs.d
-
Launch emacs without any arguments like
$ emacs
. You'll see a number of package fetch and compilation messages fly by as Emacs installs all of the packages specified in init.el.
If you didn't encounter any errors you've likely arrived at a simple, stable Emacs configuration. The configuration is annotated, so feel free to read and edit as you see fit.
Enjoy
If you try to follow along into the Paredit sections you'll be sorely disappointed when you start trying to do things like C-<Right>
. The problem is this: every Mac terminal sends the incorrect key codes to your terminal, and by-proxy, Emacs.
Fix this by following the excellent instructions of Cosmin Stejerean's Emacs + paredit under terminal. His instructions address how to fix Terminal.app, iTerm and iTerm2 to send the proper key codes for using Paredit.
WOW! Nice!