Lem

/images/lemming.png

Introduction

Lem is an Emacs-style editor running on Common Lisp that is multithreaded and very easy to customize. Because it is an entirely dynamic program (except for some CFFI parts) you can modify any part of the running editor from its own REPL. This makes it very fun to work with, I also find it a lot easier to figure out how to do things in Lem than I do with GNU Emacs.

If you are developing mostly Common Lisp, Lem is a great environment to do it in.

/images/lem-screenshot-1.png

Installation

My recommendation

Build Lem from source to get the latest features:

git clone https://github.com/lem-project/lem.git
cd lem
make sdl2
./lem

Install dependencies as required by build errors :)

Other methods

Features

Editing modes

vi-mode and paredit-mode are packaged with Lem, which I am happy with using.

Code completion

Lem has extremely good support for navigation and completion with Common Lisp, and LSP works as demonstrated with Golang below:

/images/lem-go-completion.png

(it may dissapoint you, but this blog is served with Go :()

Multiple frontends

Currently there is a terminal ncurses frontend, and a graphical SDL2 frontend (an Electron frontend is in the works too).

I prefer SDL2, but appreciate the support for ncurses because it is handy over SSH.

Config

Similar to Emacs, but you are going to want to load a Common Lisp module. Feel free to use my config.

Some other people's Lem configurations:

Troubleshooting

Building

If building from source you may have to read the CFFI grovel errors and install the appropriate system packages.

Emojis (sdl2 null pointer issue)

Some systems don't build sdl2_ttf in such a way that Lem can properly render emojis (notably: Arch and OpenBSD).

If you try to view an emoji in Lem, you will see this:

/images/lem-error-sdl2.png

To solve this on Arch Linux, install this version of sdl2_ttf

Copy/Paste

Install xclip.

Conclusion

Lem is not a replacement for Emacs for everyone, it is making consistent progress, but don't expect to have every feature from GNU Emacs ready. For example, there is not yet an org-mode package for Lem.

However, if you are like me and enjoy tinkering with your editor or just want deep integration with Common Lisp, Lem is a lot of fun.

/images/lisp-warning.png


2024-01-07