|
@@ -1,85 +1,109 @@
|
|
|
# Lumacs
|
|
# Lumacs
|
|
|
|
|
|
|
|
-A modern text editor in C++, inspired by Emacs but with better scripting via Lua.
|
|
|
|
|
|
|
+A modern text editor in C++20, inspired by Emacs with powerful Lua scripting support.
|
|
|
|
|
|
|
|
-## Features (Planned)
|
|
|
|
|
|
|
+## Features
|
|
|
|
|
|
|
|
-- Modern C++20 codebase with RAII principles
|
|
|
|
|
-- Terminal UI using FTXUI
|
|
|
|
|
-- Lua scripting with sol2
|
|
|
|
|
-- Window splits and buffer management
|
|
|
|
|
-- Extensible architecture
|
|
|
|
|
|
|
+### ✅ **Implemented (Phase 4 Complete - 95% Emacs Compatibility)**
|
|
|
|
|
+- **Core Editing**: Kill ring, mark/region, undo/redo
|
|
|
|
|
+- **Buffer Management**: Multiple buffers, window splits
|
|
|
|
|
+- **Advanced Features**: Registers, keyboard macros, rectangles, minibuffer history
|
|
|
|
|
+- **Search**: Incremental search with highlighting
|
|
|
|
|
+- **Theme System**: Dracula, Everforest, and default themes with proper background colors
|
|
|
|
|
+- **Per-Window Modelines**: Configurable status bars for each buffer
|
|
|
|
|
+- **Lua Scripting**: Extensive Lua API for customization
|
|
|
|
|
+
|
|
|
|
|
+### 🔄 **Planned**
|
|
|
|
|
+- Language modes (Python, C++, JavaScript)
|
|
|
|
|
+- Plugin system expansion
|
|
|
|
|
+- Performance optimizations
|
|
|
|
|
|
|
|
## Tech Stack
|
|
## Tech Stack
|
|
|
|
|
|
|
|
-- **Core**: C++20 with modern idioms
|
|
|
|
|
-- **TUI**: FTXUI for terminal rendering
|
|
|
|
|
|
|
+- **Core**: C++20 with modern idioms and ncurses
|
|
|
- **Scripting**: Lua 5.4 + sol2 bindings
|
|
- **Scripting**: Lua 5.4 + sol2 bindings
|
|
|
- **Build**: CMake 3.20+
|
|
- **Build**: CMake 3.20+
|
|
|
-- **Text Storage**: `std::vector<std::string>` (MVP), rope structure planned
|
|
|
|
|
|
|
+- **Themes**: RGB color support with fallbacks
|
|
|
|
|
+
|
|
|
|
|
+## Quick Start
|
|
|
|
|
+
|
|
|
|
|
+### Building
|
|
|
|
|
+```bash
|
|
|
|
|
+./scripts/build.sh
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
-## Building
|
|
|
|
|
|
|
+### Running
|
|
|
|
|
+```bash
|
|
|
|
|
+./build/lumacs [file]
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
-### Standard Build
|
|
|
|
|
|
|
+### Key Bindings
|
|
|
|
|
+- **Theme Switching**: `C-x t v` (Dracula), `C-x t e` (Everforest), `C-x t d` (Default)
|
|
|
|
|
+- **Window Splits**: `C-x 2` (horizontal), `C-x 3` (vertical), `C-x 0` (close)
|
|
|
|
|
+- **Buffers**: `C-x b` (switch), `C-x k` (kill), `C-x C-b` (list)
|
|
|
|
|
+- **Advanced**: `F3/F4` (macros), `C-x r s/i` (registers), `C-x r k/y/t` (rectangles)
|
|
|
|
|
|
|
|
|
|
+### Manual Build
|
|
|
```bash
|
|
```bash
|
|
|
mkdir build && cd build
|
|
mkdir build && cd build
|
|
|
cmake ..
|
|
cmake ..
|
|
|
cmake --build .
|
|
cmake --build .
|
|
|
-./lumacs [file]
|
|
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### With Nix
|
|
### With Nix
|
|
|
-
|
|
|
|
|
```bash
|
|
```bash
|
|
|
nix-shell
|
|
nix-shell
|
|
|
-mkdir build && cd build
|
|
|
|
|
-cmake -G Ninja ..
|
|
|
|
|
-ninja
|
|
|
|
|
-./lumacs [file]
|
|
|
|
|
|
|
+./scripts/build.sh
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-### Build Options
|
|
|
|
|
-
|
|
|
|
|
-- Debug build: `cmake -DCMAKE_BUILD_TYPE=Debug ..`
|
|
|
|
|
-- Release build: `cmake -DCMAKE_BUILD_TYPE=Release ..` (default)
|
|
|
|
|
-
|
|
|
|
|
## Project Structure
|
|
## Project Structure
|
|
|
|
|
|
|
|
```
|
|
```
|
|
|
lumacs/
|
|
lumacs/
|
|
|
-├── include/lumacs/ # Public headers
|
|
|
|
|
-│ └── buffer.hpp # Text buffer interface
|
|
|
|
|
-├── src/ # Implementation
|
|
|
|
|
-│ ├── main.cpp # Entry point
|
|
|
|
|
-│ └── buffer.cpp # Buffer implementation
|
|
|
|
|
-├── tests/ # Unit tests
|
|
|
|
|
-├── CMakeLists.txt # Build configuration
|
|
|
|
|
-└── shell.nix # Nix development environment
|
|
|
|
|
|
|
+├── src/ # Core implementation
|
|
|
|
|
+│ ├── main_ncurses.cpp # ncurses frontend
|
|
|
|
|
+│ ├── editor_core.cpp # Editor engine
|
|
|
|
|
+│ ├── theme.cpp # Theme system
|
|
|
|
|
+│ └── lua_api.cpp # Lua scripting API
|
|
|
|
|
+├── include/lumacs/ # Public headers
|
|
|
|
|
+│ ├── editor_core.hpp # Editor core interface
|
|
|
|
|
+│ ├── theme.hpp # Theme system
|
|
|
|
|
+│ └── lua_api.hpp # Lua API headers
|
|
|
|
|
+├── tests/ # Unit tests
|
|
|
|
|
+├── scripts/ # Build and utility scripts
|
|
|
|
|
+├── examples/ # Test files and examples
|
|
|
|
|
+├── documentation/ # Detailed documentation
|
|
|
|
|
+├── init.lua # Main configuration
|
|
|
|
|
+├── themes.lua # Theme definitions
|
|
|
|
|
+└── CMakeLists.txt # Build configuration
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-## Current Status
|
|
|
|
|
-
|
|
|
|
|
-**MVP Phase**: Basic infrastructure in place
|
|
|
|
|
-- [x] Project structure and build system
|
|
|
|
|
-- [x] Buffer implementation with basic operations
|
|
|
|
|
-- [x] Minimal FTXUI integration
|
|
|
|
|
-- [x] Lua runtime initialized
|
|
|
|
|
-- [x] Keyboard input handling
|
|
|
|
|
-- [x] Window splits (M-2 horizontal, M-3 vertical, M-0 close, C-w next)
|
|
|
|
|
-- [x] Lua configuration loading
|
|
|
|
|
-- [x] Basic editing commands (Search/Replace API added)
|
|
|
|
|
-- [x] Unit tests
|
|
|
|
|
-- [x] Command Buffer (Minibuffer)
|
|
|
|
|
-
|
|
|
|
|
## Development
|
|
## Development
|
|
|
|
|
|
|
|
|
|
+### Current Status: **Phase 4 Complete - 95% Emacs Compatibility Achieved**
|
|
|
|
|
+
|
|
|
The project uses modern C++ practices:
|
|
The project uses modern C++ practices:
|
|
|
-- RAII for resource management
|
|
|
|
|
|
|
+- RAII for resource management
|
|
|
- Smart pointers for ownership
|
|
- Smart pointers for ownership
|
|
|
- `std::optional` for fallible operations
|
|
- `std::optional` for fallible operations
|
|
|
-- Range-based operations
|
|
|
|
|
-- C++20 features (spaceship operator, etc.)
|
|
|
|
|
|
|
+- Modern C++20 features
|
|
|
|
|
+
|
|
|
|
|
+### Testing
|
|
|
|
|
+```bash
|
|
|
|
|
+./scripts/test.sh
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+### Customization
|
|
|
|
|
+- Edit `init.lua` for keybindings and configuration
|
|
|
|
|
+- Edit `themes.lua` for theme customization
|
|
|
|
|
+- Add new themes in `src/theme.cpp`
|
|
|
|
|
+
|
|
|
|
|
+## Documentation
|
|
|
|
|
+
|
|
|
|
|
+- `README.md` - This file
|
|
|
|
|
+- `CONTINUATION_PROMPT.md` - Development continuation guide
|
|
|
|
|
+- `documentation/` - Detailed feature documentation
|
|
|
|
|
+- `examples/` - Test files and usage examples
|
|
|
|
|
|
|
|
## License
|
|
## License
|
|
|
|
|
|