This is a minimal environment to set up a vagrant box for Common Lisp development. It includes the following features:
- Vagrant support through Virtualbox
- 64-bit Ubuntu 18.04 Bionic Beaver Linux distribution
- 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.
Emacs with slime is the dominant IDE used in the Common Lisp world as of 2015.
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.
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
.
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
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.
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
.
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.
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)
- Practical Common Lisp by Peter Seibel / buy from amazon
- Land of Lisp: Learn to Program in Lisp, One Game at a Time! by Conrad Barski / buy from amazon
- Common Lisp the Language by Guy Steele / buy from amazon
- Setting up a Vim-based Common Lisp development environment on Ubuntu
- Quickstart: Getting Started with Clojure via Vim, Lein, Slimv (Windows + Linux)
- Using Vim for Lisp development
If you are stuck in a LISP REPL and need to exit it, you can type:
(quit)
and the REPL will exit.