$ show martanne/vis
Vis is a modal text editor that combines vi-like editing with sam's structural regular expressions. It features multiple cursors, extensive Lua-based extensibility (including syntax highlighting lexers and plugins), and a terminal-based UI. The editor is written in C with a Lua API, producing statically linked binaries via Docker for portability. Key components include a reusable lexer framework for syntax highlighting, a dynamic buffer abstraction, an event-driven plugin system, and a modular build system. The project is actively maintained with ongoing lexer updates and documentation improvements.
The LLM identified 4 files worth highlighting for reuse:
Provides a reusable, LPeg-based lexer framework for syntax highlighting. Each language lexer is a self-contained module that exports a lexer object, supporting rule embedding, folding, and line-by-line processing. This pattern is reusable in any project requiring syntax highlighting and demonstrates skill in building extensible parsers.
Implements a dynamic byte buffer with efficient reserve, grow, insert, and append operations. Used throughout the editor for registers, subprocess output, etc., this buffer is completely isolated from editor-specific logic and is a classic reusable component for any C program needing a resizable buffer.
A Lua plugin that detects file types and automatically loads appropriate syntax highlighting lexers. It uses the editor's event system (subscribing to VIS_EVENT_FILE_OPEN) and demonstrates how plugins can extend editor functionality without modifying core code. This pattern is reusable for any application seeking Lua-based extensibility with event-driven hooks.
A modular Makefile that supports multiple targets (e.g., 'all', 'vis', 'docker'), conditional compilation via config.mk, and a Dockerfile for producing statically linked binaries. This build system is reusable for other C projects aiming for portability and ease of distribution, showing skill in managing complex builds with clear separation of concerns.