Common Lisp Vagrantfile
Puppet NewLisp Emacs Lisp
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Common Lisp Vagrantfile

This is a minimal environment to set up a vagrant box for Common Lisp development. It includes the following features:

  • 32-bit Ubuntu 14.04 Trusty Tahir based
  • SBCL
  • clisp
  • Emacs 24
  • Quicklisp
  • Slime
  • vim 7.3
  • slimv
  • syntastic
  • tmux
  • Port 80 forwarded to localhost:8000

To set up, clone the repository and run:

 vagrant up

The new box can be accessed by typing:

 vagrant ssh

The contents of the current directory can be accessed from the virtual machine at /vagrant, so you can clone the repository to a new folder and copy your projects there (cleaner) or just throw the files into your project's main directory (less clean).

This project is licensed under the MIT Licence. See LICENCE.txt for the full text.

This project not only installs the Steel Bank Common Lisp package, but also installs support for Read-Eval-Print-Loop (REPL) integrations and language helpers for both emacs and vim.

It also installs the GNU clisp implementation, partly to support syntax / style checking with the vim syntastic extension.

Getting started with emacs and slime

Emacs with slime is the dominant IDE used in the Common Lisp world as of 2015.

emacs slime session showing compilation output

A step-by-step tutorial is available as part of this blog by Bill Clementson that is an extract from this common lisp music course by Matt Wright and Fernando Lopez-Lezcano. The slime reference manual is available online.

emacs and slime for the impatient

Start emacs:

emacs hello.lisp

Invoke M-x slime to start the REPL, and type lisp expressions:

(format t "Hello, world!~%")
(+ 1 2)

Switch back to your editor window:

C-x b hello.lisp

Add some lisp code, save wih C-c C-s and quit with C-c C-x.

Getting started with vim and slimv

If you would rather use a vi-family editor, don't despair. A port of slime to vim called slimv is available and configured in this image.

vim and slimv session showing syntastic output

vim is configured with a slimv menu that you can get to using tab completion with the :emenu slimv command, or by hitting the F4 key.

The slimv tutorial goes into detail about using slimv for lisp development.

vim and slimv for the impatient

Start vim:

vim hello.lisp

Invoke :emenu Slimv.Repl.Connect-Server to start the REPL. Switch to it with control-w j, enter insert mode with i and type lisp expressions:

(format t "Hello, world!~%")
(+ 1 2)

Switch back to your editor window by typing esc control-w j.

Add some lisp code, save wih :w and quit with :q.

vim, slimv, and tmux integration

This installation includes tmux support primarily to support the slimv integration with swank, the lisp execution server shared by slime and slimv. This tmux primer will get you started using tmux, though you do not really need to get into the minutiae just to get vim and slime to work with swank.

The vim installation is set up using Pathogen and the vim-sensible and slimv plugins. Thanks go to iconoclast and godlygeek on Stack Exchange for the menu F4 keybinding suggestion.

Quicklisp package management

This setup uses quicklisp for LISP package management. See the instructions in the previous link for instructions on loading packages. The sbcl installation in this package already has quicklisp loaded into its init files.

For example, invoke sbcl or start a slime/slimv REPL within emacs or vim and issue these statements in order to load the web development framework clack:

(ql:quickload :clack)

Further Reading


If you are stuck in a LISP REPL and need to exit it, you can type:


and the REPL will exit.