A minimalistic modal text environment, containing your code without distraction.
site · releases · hako-code · org
![]() 紙 Kami: file explorer |
![]() Split panes + 零 Rei AI (powered by hako-code) |
![]() Multi-pane splits · resize with Ctrl-W
|
![]() Theme picker · 17 presets |
零 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 (sho-stock / koi-mini-stock) 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 - Line Numbers: absolute or relative, dynamic width
- Mouse Support: click to position, scroll wheel moves cursor
- 17 Themes: dark, light, gruvbox, nord, dracula, monokai, solarized, tokyonight, catppuccin, onedark, material, everforest, rosepine, github-dark, github-light, ayu, kanagawa
- 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
makeRun
./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 [filename] |
Open file |
:q |
Quit |
:wq |
Save and quit |
Ctrl-F |
Page forward |
Ctrl-B |
Page backward |
| 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 |
| 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 |
|---|---|
/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
# 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 ——
Editor renamed to hake (binary) / hako-edit (repo). Aligns with the v0.1.6 hako-code + hako-models suite.
- CLI rename:
hako→hake. Source filehako.c→hake.c; macrosHAKO_*→HAKE_*; status bar readsHAKE v0.1.3; help text +--versionupdated. Splash now showsEDITunder the block-letter logo. - Subprocess wire updated. Internal symbols
claw*→hako*(the wire is to thehakoagent, not to the legacyclawname).hakeFindBinarysearches forhakoonPATH/~/.local/bin//usr/local/bin.BUNDLE_HAKO=1(default) compiles../hako-code/hako.calongsidehake. - Mithraeum default theme — void / paper / gold / rust palette matches the site banners + hake / hako-code icons. Boot default; 17 other presets still available via
:theme <name>. - SIGPIPE-safe — hako agent crashing mid-turn no longer kills the editor;
hakoSendLinedetectsEPIPE,hakoShutdownreaps cleanly. - Config consolidation. Both
hakeandhakoread~/.hakorc(was~/.hakocrcon the agent side); editor-only keys and AI keys coexist under sectioned headers.
See CHANGELOG.md for full history.
—— VII ——
- Windows parity
- Diff-render (fewer redraws)
- In-editor slash menus for themes and settings
- Write-file diff preview with confirm
- OpenAI/Ollama tool parity
- Buffer list (
:ls,:b)
—— 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 —




