This project is what happens when you ask, "What if my text editor had a camera?".
text-editor-demo2.webm
- Basic text editing
- Camera that smoothly follows the cursor
- File Browser that displays directories in 2D space
- SDF text rendering
Though this project is mainly in C, it uses Zig as it's compiler/build system. I really love this feature of Zig, and it allows doing some neat stuff (check out the filesystem code)!
Note: I'm still in the exploratory phase of development right now, so the code is pretty messy. The project will definitely be rewritten in the future (probably in Zig!).
git clone --recursive https://github.com/Parzival-3141/text-editor.git
You'll need the self-hosted Zig compiler.
zig version
0.11.0-dev.3180+b754068fb
Then just call zig build run
in the project root.
Ctrl+ScrollWheel | Zoom in/out |
Ctrl+0 | Reset zoom |
Input | Action |
---|---|
Arrow Keys | Moves the cursor |
Escape | Goes up a directory |
Enter | Opens the directory or file under the cursor |
Input | Action |
---|---|
Arrow Keys | Moves the cursor |
Ctrl+Arrow Keys | Moves the cursor by word |
Escape | Closes the text box |
Enter | Newline |
Backspace | Remove character to the left |
Delete | Remove character to the right |
Home | Move cursor to line start |
End | Move cursor to line end |
Dependencies are included in the repo and are built from source, so you shouldn't have any issues.
- Builing with
-Doptimize=ReleaseFast
causes the compiler to hang while analyzingsrc/fs.zig
. Not sure why, but it's most likely a compiler bug due to regression in the C backend.