An emacs-y text editor written in Ante (and Scheme), with
approximately the feature set of mg plus some support for tree-sitter
and LSP etc.
This project was partly written by AI and partly AI-translated from existing code.
./build.sh
which is short for
./scripts/configure.sh
ninja pc
Dependencies:
- Currently requires a patched version of Ante.
- cargo, ninja, libvterm, libuv1
- chez scheme (or pseudoscheme)
The built-in Lisp implementation is an R5RS Scheme except that it offers minicoro-based coroutines instead of call/cc.
Its bytecode compiler is written in portable scheme, while the runtime uses cranelift to lower that bytecode to native code.
To bootstrap the compiler, one of the following Schemes needs to be installed:
- chez scheme (default)
- or pseudoscheme on SBCL
ninja lispboot # uses the bootstrap host to produce a partially complete lisp binary
ninja lisp # uses lispboot to have the compiler compile itself
The main build ninja pc then builds the Scheme sources of the editor
using the bootstrapped lisp binary. ./lisp --repl shows a basic Scheme repl.
M-. and M-z are prefixes in this editor as follows:
| Key | Command |
|---|---|
| M-. . | find-definition |
| M-. t | textDocument/typeDefinition |
| M-. i | textDocument/implementation |
| M-. r | textDocument/references |
| M-z z | (zap-to-char not implemented yet) |
| M-z c | textDocument/codeAction |
| M-z s | textDocument/signatureHelp |
To ensure that sessions are never lost on exit, events are written to a session file as they happen, and then replayed on startup. The default session is at ~/.config/pc/slog/default. --session can be used to select a different session name. --no-session suppresses session loading. M-x list-sessions shows as session menu.
M-x open-project is used inform the editor about the root directory of a project. Projects are saved in the persistent log ~/.config/pc/plog so that they survive restarts across sessions.
Once the project is open, M-x lsp starts an LSP server. Whether LSP should be running for a project is saved in the session log (not the plog) so that the LSP will restart automatically only if that session is resumed.
More commands:
| Key | Command |
|---|---|
| M-TAB aka C-M-i | textDocument/completion |
| C-h A | workspace/symbol |
| C-h . | textDocument/hover |
Hover is a command also because the editor doesn't know whether the mouse is hovering. When the symbol at point is hoverable it is underlined. Clicking also shows hover information.
LSP servers need to be preinstalled and in PATH under these names:
| Extension | Language | LSP server binary |
|---|---|---|
| .an | Ante | ante-ls |
| .c, .h | C | clangd |
| .go | Go | gopls |
| .java | Java | javalyzer |
| .kt | Kotlin | kotlin-lsp.sh |
| .rs | Rust | rust-analyzer |
LIME (M-x lime) is a basic Common Lisp mode based on Swank (swank-loader needs to be preinstalled).
Scheme files are currently opened in a mode for developing the editor itself, so rather than calling out to a separately Scheme process they refer to the editor process's in-memory Scheme. M-x iscm starts the Scheme REPL.
M-x opencode and M-x codex opens a basic REPL for the opencode and codex harnesses, respectively.