A simple terminal-based text editor written in Janet. Inspired by (but not a full faithful recreation of) this guide by paigeruten.
Finished (at least mostly):
- TUI text editing (file loading, editing, saving)
- Lightweight executable
- Mobile-friendly (e.g. in Termux on Android)
- Syntax highlighting (for supported languages)
- Mouse support (clicking and scrolling)
- Basic search
Planned:
- Unlimited undo/redo history
- Command palette
- Persistent configuration (via dotfile)
- Multiple files open at once
- Multi-cursor editing
- RegEx find and find + replace
- Plugin system
Requires Janet and JPM. Not tested on Windows.
-
Clone this repo (for e.g., with the GitHub CLI,
$ gh repo clone CFiggers/joule-editor
.) -
Change directories into the cloned repo:
$ cd joule-editor
-
Fetch and install required dependencies:
$ jpm deps
(on Ubuntu and similar systems, may required elevated permissions, e.g.$ sudo jpm deps
)
Now you can either build a native binary executable using $ jpm build
or run the Janet source code directly using the janet
command and passing in the src/joule.janet
source file.
- To Build a Native Executable:
$ jpm build
$ ./build/joule
- Or to Run as a script using Janet:
$ janet src/joule.janet
Joule is not a modal editor, meaning you can immediately start typing to make edits without needing to enter a specific editing mode (like vi and vim).
Binding | Action |
---|---|
Ctrl + q | Quit |
Ctrl + l | Load File |
Ctrl + s | Save |
Ctrl + a | Save As |
Ctrl + f | Find |
Ctrl + g | Go To Line |
Ctrl + c | Copy (to internal clipboard) |
Ctrl + x | Cut (to internal clipboard) |
Ctrl + p | Paste (from internal clipboard) |
Ctrl + n | Toggle Line Numbers |
Ctrl + w | Close Current File |
Ctrl + d | Open Debug REPL |
Shift + Del | Delete current line |
Copyright (c) 2022 Caleb Figgers