A text editor inspired by Emacs with Lua at it's core

Bernardo Magri 2e95afa9a7 fix(raylib): unified input processing loop 1 week ago
documentation b9976750bd fix(build): resolve GTK3/GTK4 symbol conflict by splitting binaries 1 week ago
include b9976750bd fix(build): resolve GTK3/GTK4 symbol conflict by splitting binaries 1 week ago
lua bcbdff2d8c feat(packages): add monorepo support to package manager 1 month ago
resources 5e62678f67 adding logo small and docs 1 month ago
scripts 6b964131b4 feat(lua): Expand LuaApi test coverage and fix sol2 binding issues 1 month ago
src 2e95afa9a7 fix(raylib): unified input processing loop 1 week ago
tests 3a92acee04 fix(defaults): Register standard commands and fix cursor updates 1 month ago
.envrc 4f1529bcf9 switching to ncurses 1 month ago
.gitignore b8ab662d53 chore: Add .gemini/ to .gitignore 1 month ago
CMakeLists.txt b9976750bd fix(build): resolve GTK3/GTK4 symbol conflict by splitting binaries 1 week ago
GEMINI.md 637e06dc49 refactor: Break circular dependencies with interfaces 1 month ago
README.md d505891c13 updating architecture and readmen files 1 month ago
init.lua 013c94a94a improving GTK frontend 1 month ago
shell.nix b9976750bd fix(build): resolve GTK3/GTK4 symbol conflict by splitting binaries 1 week ago

README.md

Lumacs

A modern, highly customizable text editor engine written in C++20, deeply inspired by Emacs and featuring powerful Lua 5.4 scripting support. Lumacs emphasizes a clear separation between its core logic and UI, making it both flexible and extensible.

Features

Lumacs aims to provide a rich, Emacs-like editing experience with a focus on configurability and modern C++ practices.

✅ Implemented Features

The editor currently boasts a wide array of functional features, as detailed in the Development Plan.

  • Core Emacs Editing DNA:

    • Buffer Management: Robust handling of multiple buffers, including switching, listing, and closing.
    • Kill Ring: Complete Emacs-style cut/copy/paste (kill, yank, yank-pop) operations.
    • Mark & Region: Full functionality for setting marks, defining regions, and extracting text.
    • Registers: Emacs-like named registers for storing and inserting text.
    • Rectangles: Comprehensive operations for killing, yanking, and manipulating rectangular blocks of text.
    • Text Editing: Basic insertion, deletion, and replacement, handling multi-line scenarios and buffer events.
    • Undo/Redo: Functionality for reverting and re-applying changes.
    • Window Splits: Dynamic horizontal and vertical window splitting, closing, and navigation.
    • Input System: Functional keyboard input handling across GTK and TUI.
    • Cursor System: UI-agnostic cursor position/movement logic.
    • Scrolling System: Full vertical and horizontal scrolling with auto-adjustment.
  • Advanced UI & System Integration:

    • Theme System: A robust and flexible theming engine with 6 professional themes (Dracula, Everforest, Nord, Solarized, Gruvbox, Default).
    • Minibuffer & Command System: A functional interactive minibuffer with tab completion, history navigation, and command execution.
    • Syntax Highlighting: Pango-based text rendering with syntax highlighting based on a face system.
    • GTK Frontend: Primary GUI using GTK4 / gtkmm, supporting Pango/Cairo rendering with caching.
    • Ncurses TUI: Functional terminal user interface serving as a fallback.
    • Modeline: Modular and extensible status bar.
    • Completion: Advanced completion with popup support.
  • Extensibility:

    • Lua Scripting: Comprehensive Lua 5.4 API for extending and customizing the editor.
    • Plugin Management: Dynamic loading and lifecycle management of Lua plugins.
    • Lua Debugging: Integrated remote debugging support via MobDebug.

🔄 Planned Enhancements

  • Language Modes: Expand support for various language modes (Python, C++, JavaScript).
  • Performance Optimization: Further rendering optimizations for large files.
  • Testing: Continued expansion of test coverage.

Tech Stack

  • Core: C++20
  • UI: GTK4 / gtkmm (GUI), Ncurses (TUI)
  • Scripting: Lua 5.4 with sol2 bindings
  • Build: CMake 3.20+
  • Logging: spdlog
  • Testing: Google Test

Quick Start

Building

cmake -B build -S .
cmake --build build -j4

Running

./build/lumacs [file]

Key Bindings

Common Emacs-like keybindings are supported. Refer to init.lua for the full default keymap.

  • Theme Switching: M-x set-theme (then use Tab for completion)
  • Window Splits: C-x 2 (horizontal), C-x 3 (vertical), C-x 0 (close window), C-x o (next window)
  • Buffers: C-x b (switch buffer), C-x k (kill buffer), C-x C-b (list buffers)
  • Advanced: F3 (start macro), F4 (end macro/call macro), C-x r s (copy to register), C-x r i (insert register), C-x r k (kill rectangle), C-x r y (yank rectangle)

Documentation

License

MIT