Energy starts surging through your fingertips. Sparks fly, making the shadows grow and flicker ominously around you. You arch your back and open your eyes as if for the first time. The text appears more vibrant and colourful than you remember. Your fingers dance on the keyboard commanding the cursor with a joyful precision and control. You lean back and marvel as a shimmering swirl of syntactic and semantic structures project out of the screen and intertwine with a fractal beauty. You watch as meaning recursively unfolds into deeper meaning live in front of your eyes. You feel a deep and lasting synchronicity form as the boundaries between you and your Emacs wash away. You and your Emacs Live. M-x start-hacking.
- a jolly good generic Clojure hacking config
- a nice structured approach to organising your Emacs config
- modular in that functionality is organised by discrete packs
- a decent starting point for live coding in general
- a goldmine of config snippets to plunder and add to your own config
So, wherever you are in the multiverse, Emacs Live is ready to join you in battle against the evil friction of poor text editor workflows.
"Power of the horse, full force!" The Space Stallions.
Emacs Live is only compatible with Emacs 24 and above.
If you're the kind of shoot-from-the-hip brogrammer that doesn't mind executing random scripts from the interwebs, then the easiest way to install Emacs Live is to run the following which will safely preserve any Emacs configs you already have:
bash <(curl -fksSL https://raw.github.com/overtone/emacs-live/master/installer/install-emacs-live.sh)
Note: you should always read through random scripts before executing them!
The (only ever-so-slightly) more involved way to install is to follow these steps:
- Move aside
~/.emacs.dif they currently exist.
- Download the zip bundle (or clone the repository with git) and move
and rename to
- Launch Emacs version 24+
- Live code your hat off!
Simply start a repl in a Clojure project with
lein2 repl and connect
to it from Emacs with
M-x nrepl (supplying the correct port) for full
Emacs REPL/autocompletion joy.
Here's a video showing the config in use: Quick Intro to Live Programming with Overtone
Emacs Live is powered by a number of special packs. Packs are directories which are used to store isolated sets of functionality and configuration. These may be symlinks or git submodules depending on how you choose to store and manage your dot emacs.
Each pack consists of three components: the
config dir and
lib dir. The
init.el file is loaded first and it is here that you
can run arbitrary elisp. However, it is recommended that you organise
your pack by placing library code in the lib dir and individual config
files in the config dir. Emacs Live provides helper fns to make it easy
for you to load config files and for you to add lib dirs to your load
path. See the section on helper fns below.
Emacs live ships with a few packs:
A set of defaults to create a clutter free, friendly and more dynamic Emacs foundation. Also adds fuzzy matching autocomplete functionality for most of the Emacs minibuffer action - such as finding files, calling functions and switching buffers.
Colour highlighting in two flavours - cyberpunk and gandalf. User
color-theme-gandalf to switch between the
two themes. Currently cyberpunk has seen more love - patch requests
accepted for appropriate improvements to Gandalf.
A set of goodies to get you hacking Clojure like a pro.
- Clojure Mode (with fancy (λ a) and ƒ(+ % 5) prettifications)
- nREPL.el (for communicating with nREPL servers)
- Auto completion (configured to work with nREPL for inline auto completion of documentation)
- Tailor-made colour theme
- Fancy highlighting of sexps on eval
- Rainbow parens and delimiters (to allow you to easily navigate a sea of parens)
A number of extra language modes for your joy. Languages include:
A boost of fantastic functionality for your live-coding fingertips. Highlights include:
- The amazing undo-tree (live-code with confidence!)
- Textmate-like snippets
- Refheap mode for pasting snippets to refheap.com
- Quick jump mode for accessing previous locations
- Ace jump mode for jumping directly to any symbol on the screen with 2 or three keystrokes.
By default, Emacs live will load the packs in the following order:
However, you may create a
~/.emacs-live.el file to override this
behaviour. Simply set the var live-packs to a list of symbols
representing the packs you'd like to load up (the order will be
honoured). For example to only load the foundation and colour packs:
(live-use-packs '(live/foundation-pack live/colour-pack))
If just you wish to load your own packs after the default packs then
Packs are expected to reside in
~/.emacs.d/packs/ unless you specify
them with absolute paths in which case the absolute path with be
Emacs Live provides a couple of useful helper fns which you can use within your own live packs:
live-pack-lib-dirthis returns the path of the lib dir for the current pack
live-load-config-fileloads a config file located in the config dir of the current pack
It is recommended that you place your own personal packs in an external
directory. See the
user/template-pack's README for more information.
I'm very happy to hear any feedback regarding this config. The idea is for you to use it to get started and give you a platform to start editing it and turning it into something personal.