A minimalistic modal text environment, containing your code without distraction.
site · releases · hako-code · org
![]() 箱 Kami: file explorer |
![]() 箱 Rei AI (powered by hako-code) |
![]() Multi-pane splits · resize with Ctrl-W
|
![]() Launch splash · mithraeum theme |
箱 Rei lives inside hake; powered by hako-code:
▄█████▄
██ ███ ██ Rei: v1.1
█████████ Provider: You Choose
▀█▀▀█▀▀█▀ Model: You Choose
—— I ——
- Modal Editing: Vim-inspired normal, insert, visual, and visual-line modes
- Full Motion Set: counts, named registers, text objects (
diw,ci",da(), marks, jumplist, dot-repeat,:s/substitution, bracket match - Multi-Pane Support: Split horizontally and vertically, resize with
Ctrl-W +/-/</> - File Explorer: 箱 Kami - directory navigation, hidden-file toggle, dirs-first sort
- AI Assistant: 箱 Rei - powered by hako-code in a split pane. Local hako models (
hako-sho3B /hako-koi7B) or any of its 13 cloud providers, function-calling tool loop, SSE streaming, per-project trust and history - Skills: drop
~/.hako/skills/*.mdinto the system prompt, install from any URL with/skill install - Syntax Highlighting: 40+ languages, search-match highlighting persists across edits
- Undo/Redo: time-bounded undo blocks, configurable depth
- Visual Selection: character and line modes with yank/delete/change, count feedback
- Clipboard: bracketed paste, system clipboard via
Ctrl-C/Ctrl-V - Fast Search: incremental with
n/N, all matches highlighted - Runner:
:build/:test/:runstream into a bottom pane while you edit;]e/[ejump tofile:lineerrors;ahands the error to Rei.:!<cmd>for quick one-shots - Line Numbers: absolute or relative, dynamic width
- Mouse Support: click to position, scroll wheel moves cursor
- 18 Themes: mithraeum, dark, light, gruvbox, nord, dracula, monokai, solarized, tokyonight, catppuccin, onedark, material, everforest, rosepine, github-dark, github-light, ayu, kanagawa — live-preview picker via
:theme - Customizable: every setting in
.hakorc, model/provider choices persist in~/.hako/state
—— II ——
# One-liner - works on Linux, macOS, Windows (mingw)
gcc hake.c -o hake -lpthread
# Or use the Makefile to also embed the executable icon where the OS allows
make
# Build flavors
make BUNDLE_HAKO=1 # default — also builds the hako agent next to hake
make BUNDLE_HAKO=0 # editor only; :install-agent fetches the agent later
make NO_AGENT=1 # editor with no agent path at all (Rei pane stays inert)Run
./hake # or ./hake [filename]Install (drop the binary into your PATH):
cp hake /usr/local/bin/hake # Linux / macOSDeps: C standard library + POSIX/Win32 system headers +
pthread. No third-party libraries linked. AI features shell out tocurl(1)at runtime.
# Curl one-liner (Linux / macOS / Windows-MinGW)
curl -fsSL https://raw.githubusercontent.com/mithraeums/hako-edit/main/install.sh | shVerifies sha256, installs to /usr/local/bin if writable else ~/.local/bin. macOS quarantine xattr stripped post-install. Set VERIFY=0 to skip sha verify, PREFIX=/opt to relocate.
The icon files live in icon/:
| Platform | File | What make does |
|---|---|---|
| Windows | hake.ico |
Embeds icon into .exe via windres; real OS icon. |
| macOS | hake.icns |
Attaches icon as a resource fork via Rez+SetFile (Xcode CLT). Best-effort. |
| Linux | hake.png |
ELF can't embed icons; ship hake.png and reference it from a .desktop file. |
A plain gcc hake.c -o hake produces a working binary on every platform; the icon is purely cosmetic.
hake compiles on Alpine via iSh:
apk add gcc make musl-dev curl
makeNotes:
- AI panel needs
curlfor HTTPS requests;apk add curlis required before using Rei. - Narrow screens auto-stack the AI panel below the editor instead of squeezing horizontally.
- iSh runs single-threaded under emulation; expect slower stream rendering.
—— III ——
| Key | Action |
|---|---|
i |
Enter insert mode |
I |
Insert at first non-blank |
a |
Append after cursor |
A |
Append at end of line |
o |
Open line below |
O |
Open line above |
v |
Visual mode (character) |
V |
Visual mode (line) |
h,j,k,l |
Navigate (←↓↑→) |
w,b |
Next/previous word |
0,$ |
Start/end of line |
gg,G |
Top/bottom of file |
dd |
Delete line (yanks) |
D |
Delete to end of line |
x |
Delete character |
C |
Change to end of line |
yy |
Yank (copy) line |
p,P |
Paste after/before |
u |
Undo |
Ctrl-R |
Redo |
r |
Replace character |
J |
Join lines |
/ |
Search |
n,N |
Next/previous match |
Ctrl-C |
Copy to system clipboard |
Ctrl-V |
Paste from system clipboard |
:w |
Save |
:e <file|dir> |
Open file, or explorer at a directory (:e ..) |
:q |
Quit |
:wq |
Save and quit |
Ctrl-F |
Page forward |
Ctrl-B |
Page backward |
]e,[e |
Next/previous runner error |
:!<cmd> |
Run shell command (popup) |
:run <cmd> |
Run in the runner pane (async) |
:build,:test |
Run build_cmd / test_cmd from .hakorc |
| Key | Action |
|---|---|
h,j,k,l |
Extend selection |
w,b |
Word-wise selection |
0,$ |
Select to start/end |
gg,G |
Select to top/bottom |
Ctrl-F |
Page forward selection |
Ctrl-B |
Page backward selection |
y |
Yank selection |
d,x |
Delete selection |
c |
Change selection |
Ctrl-C |
Copy to system clipboard |
Esc |
Exit visual mode |
| Key | Action |
|---|---|
Ctrl-W s |
Split horizontal |
Ctrl-W v |
Split vertical |
Ctrl-W w |
Switch pane |
Ctrl-W c |
Close pane |
| Key | Action |
|---|---|
:e,:explorer |
Toggle explorer |
j,k |
Navigate files |
h,l |
Parent/open |
g,G |
Top/bottom of list |
. |
Toggle hidden files |
r |
Refresh |
q,Esc |
Close explorer |
:build, :test, :run <cmd> stream a command's output into a bottom pane while you
keep editing. Lines that look like file:line[:col] are highlighted and jumpable —
the compile/fix loop without leaving the editor.
| Key | Action |
|---|---|
j,k |
Select line |
Enter |
Jump to file:line[:col] under selection |
],[ |
Next / previous error line |
a |
Ask the agent to fix the selected error |
r |
Rerun |
q |
Stop if running, close otherwise |
| Key | Action |
|---|---|
:ai |
Toggle AI panel |
i |
Enter prompt mode |
Enter |
In INSERT: newline. In NORMAL: send |
Esc |
Back to NORMAL |
v |
Visual select (copy-only in history) |
j,k |
Navigate history |
Ctrl-W w |
Switch pane |
Ctrl-C |
Close panel |
:q |
Close panel |
| Command | Action |
|---|---|
:auto / :noauto |
Skip / restore per-tool permission prompts for the session |
:install-agent |
Install the hako agent in place when none is found, then connect |
:update-agent |
Self-update the agent (hako --update) and relaunch it |
:clear |
Wipe visible history · :w saves the chat to ai_chat.txt |
When the agent asks to write a file or run a command, the pane prompts inline —
● write_file foo.c then [y] once [n] no [a] always. :auto skips the prompts.
| Command | Action |
|---|---|
/help |
List commands |
/provider <name> |
ollama, anthropic, openai, deepseek, mistral, together, fireworks, openrouter, groq, xai (auto-fills endpoint) |
/model <id> |
Switch model (persists to ~/.hako/state) |
/tools on / off |
Toggle function calling |
/trust / /trust revoke |
Grant or revoke file-ops in this project |
/skills [reload] |
List / reload ~/.hako/skills/*.md |
/skill install <url> |
Download a skill into ~/.hako/skills/ |
/history local / global |
Show path, or move to <cwd>/.hako/history |
/file <path> |
Inject a local file into context |
/clear |
Wipe visible history |
/usage |
Show provider/model/trust + token totals |
/sessions |
List up to 16 prior sessions |
/session [new] |
Show session info; new resets |
/resume <id> |
Switch to prior session |
/quit |
Close the panel |
Tools (when trusted): read_file, list_dir, read_open_file, list_open_files, write_file (path constrained to project; staged when ai_autowrite=0), run_shell (project must be trusted).
Pane control (any focused pane): :q rei / :q kami (also :close <name>) closes the named side panel.
—— IV ——
Use supplied config, or generate one with :config inside the editor. HAKE looks for .hakorc in the current directory first, then your home directory.
# Example .hakorc
tab_stop=4
use_tabs=1
show_line_numbers=2
auto_indent=1
smart_indent=1
mouse_enabled=1
theme=dark
explorer_width=30
# Runner pane
# build_cmd=make
# test_cmd=make test
# run_cmd=./a.out
# AI panel (Rei)
ai_provider=deepseek # or anthropic | openai | ollama | mistral | ...
ai_api_key=sk-... # not needed for ollama
ai_model=deepseek-chat
ai_max_tokens=2048
ai_tools_enabled=1
ai_stream=1
ai_autowrite=1 # 0 stages writes to <path>.hako-pending
# ai_endpoint= # auto-set for known providers
Run :config to generate a fully documented .hakorc with all options.
—— V ——
hake provides syntax color for 40+ languages, some of which include:
Systems: C, C++, Rust, Go, Zig, Assembly
Scripting: Python, Ruby, Perl, Lua, Shell, PHP
Web: JavaScript, TypeScript, HTML, CSS, JSON
JVM: Java, Kotlin, Scala, Clojure
Functional: Haskell, OCaml, F#, Elixir
Modern: Swift, Dart, Julia, Nim
Config: YAML, TOML, Dockerfile, Makefile
—— VI ——
A lean pass plus the compile loop: smaller, straighter code and a runner pane.
- −1000 lines — comments stripped to structure, dead scaffolding deleted, duplicated logic folded into shared helpers, theme presets now a data table. Zero behavior change.
- Runner pane —
:build/:test/:run <cmd>stream output live into a bottom pane;]e/[ejump straight tofile:lineerrors;asends the selected error to the agent. :!<cmd>— shell command output in a popup, vim-style.- Fixes — mithraeum status-bar contrast, visual selection is a real highlight box (syntax colors kept), the explorer can't clobber unsaved work (splits instead),
:e <dir>opens the explorer, fast key bursts afterEscare no longer swallowed.
Interface polish, an on-brand theme, a unified config — plus two crash fixes.
- Popup menus —
:help, a bare:theme(live-preview picker), and:registersopen scrollable popups (mouse + keyboard). - Mithraeum theme on-brand — matches the site palette; gold
#b89656is the primary UI accent (borders, splash, popups, status, line numbers). - One unified
~/.hakorc—:configmerges and preserves the agent'sai_*and other tools' keys; defaultstheme=mithraeum. - Agent integration — in-pane tool-permission prompts (
[y]/[n]/[a]),:install-agent/:update-agent, agent auto-respawn, and a no-agent build (make NO_AGENT=1). - Crash fixes — closing the Rei pane (
Ctrl-C) no longer use-after-frees the agent reader thread; search no longer reads out of bounds at end of line.
Full history → CHANGELOG.md.
—— VII ——
- Windows parity (pipe agent + runner pane)
- Custom themes from
.hakorcin the theme picker - Write-file diff preview with confirm
- OpenAI/Ollama tool parity
- Buffer list (
:ls,:b) -
:etab completion
—— VIII ——
If you share the belief that simplicity empowers creativity, feel free to contribute.
- Forking this repo
- Submitting a Pull Request
- Bug reports and feature requests
Please ensure your code follows the existing style. I realize the single file is a personal choice, though if you choose to assist, I have divided the code.
Sections of codebase are as follows:
- Includes
- Defines
- Enums
- Struct Declarations
- Function Prototypes
- Syntax Highlighting
- Terminal
- Buffer
- Helpers
- Color
- Clipboard
- Pane Management
- Row Operations
- Editor Operations
- Cursor Movement
- Scrolling
- Visual Mode
- Undo/Redo
- Search
- File I/O
- Drawing
- Input
- Mode and Commands
- Main Drawing Functions
- Input Processing
- Splash Screen
- Explorer
- AI Assistant
- Init
- Main
This project started out of curiosity and a simple C text editor tutorial. If you hit any issues, feel free to open an issue on GitHub. Pull requests, suggestions, or even thoughtful discussions are welcome.
— SEE LICENSE — · GPL-3.0
— deus sol invictus mithras —




