Better Lisp support

Hey everyone! Original author of the Scheme highlighter here.

One thing I have noticed is that all the Lispy languages tend to import the Lisp plugin in the default filetypes. Normally, this wouldn’t be a problem, but the default Lisp highlighter is built for Common Lisp with some random Clojure in there. As a bit of a Lisp aficionado, there are quite a few differences between different flavors of Lisp, and having them all import from CL is a bit useless.

So here’s what I propose: we instead have a s-expressions module that does some simple highlighting for S-expression languages. Many Lisps have similar formatting for some basic stuff (Quote is almost universally single quote, except for sometimes, etc.) Also, most lisps are formatted in the same way, so they can all take advantage of an s-expression indenter.

With this, we can also have a more complete Common Lisp highlighter as well in the same vein of Scheme, where almost every construct is highlighted correctly.

Anyways, wanted to get all of your opinions on this. I’ve started some work on better CL keywords as a seperate module from the current lisp module.

3 Likes

As another Lisp enthusiast I fully agree. This is exactly the same problem people have in Emacs. Emacs has a major-mode (a.k.a. filetype) called lisp-mode, and even if it is called just lisp, it was made for Common Lisp only (debatable). So every other lisp-like language has to inherit from prog-mode instead, which has nothing to do with lisp-specific features, re-implementing a lot of these features that are common between lisps. More recently a more general-purposed lisp-data-mode was added, but it’s very bare-bones and doesn’t provide a lot of things, so languages still inherit from prog-mode.

So for Kakoune, while it’s still young it would only make sense not to repeat the same mistake that Emacs did - a separate module for dealing with S-expression style data would be a good thing, and then all other Lisp-like languages can reuse it.

1 Like