$ show m00qek/baleia.nvim
Baleia.nvim is a Neovim plugin that colorizes text with ANSI escape sequences (8, 16, 256 or TrueColor). It processes buffers containing ANSI codes, strips them from the text while applying appropriate syntax highlighting, and supports both manual and automatic colorization modes. The architecture features modular Lua components handling ANSI parsing (ansi.lua), lexical analysis (lexer.py), asynchronous processing (scheduler.lua), and Neovim highlight rendering (renderer.lua). The plugin integrates with Neovim's buffer system through autocommands and API functions, efficiently handling large files via chunked processing.
The LLM identified 3 files worth highlighting for reuse:
Implements a robust ANSI escape sequence parser handling 8-color, 16-color, 256-color, and true color sequences with text attributes (bold, italic, underline, etc.). Features optimized state machine processing, proper reset handling, and clean separation of concerns. Could be extracted for any project needing ANSI code interpretation.
Provides chunked asynchronous processing using vim.schedule with built-in cancellation and error handling. Works with both buffer-backed data (via lazy fetching) and in-memory arrays. Demonstrates proper async patterns in Neovim plugins with efficient resource management and clean API.
Applies text styles to Neovim buffers with intelligent highlight caching to prevent redundant highlight group creation. Handles color conversion between cterm and gui representations, supports theme-based color mapping, and manages Neovim's extmark system efficiently. The caching mechanism and color hydration logic demonstrate advanced Neovim plugin development techniques.