Build your own Text Editor
A terminal text editor in about a thousand lines: raw-mode input, a scrolling viewport, editing, saving, search and syntax highlighting.
- Intermediate
- About 10–20 h
- 4 checkpoints
- 2 tutorials · C, Rust
Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.
Choose a tutorialWhy build it
A terminal editor exercises the terminal itself (raw mode, escape sequences), careful buffer management and safe file I/O, in a program you can use every day.
You will be able to
- Put the terminal into raw mode and always restore it, even after an error.
- Draw the screen with ANSI escape sequences.
- Map cursor positions in a text buffer to screen columns, including tabs.
- Save files safely by writing a temporary file and renaming it.
Skills it exercises
Recommended on Operating Systems & Linux.
How you know you are there
Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.
- Checkpoint 1Self-check
Raw mode and keys
Done when: The program reads single keypresses, including arrows and Ctrl combinations, and the terminal is restored on every exit path.
- Checkpoint 2Self-check
Viewer
Done when: A file larger than the screen opens, scrolls vertically and horizontally, and a status bar shows the file name and line number.
- Checkpoint 3Self-check
Editing and saving
Done when: Characters and lines can be inserted and deleted, Ctrl-S saves, and quitting with unsaved changes asks for confirmation.
- Checkpoint 4Self-check
Search and highlighting
Done when: Incremental search jumps between matches, and numbers, strings and comments of one language are coloured.
Stretch goals
- Undo and redo.
- A gap buffer or piece table instead of an array of lines.
- UTF-8-aware cursor movement and soft wrapping.
Step-by-step guides
Pick one in a language you know (tutorial languages: C, Rust). They open on the author’s site.
- C
Build Your Own Text Editor(external site)
C, in 184 small steps that each compile. The best-known tutorial on this list.
- Rust
Hecto: Build your own text editor in Rust(external site)
Rust take on the same editor, with notes on ownership and Unicode.
Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.
Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.