<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64" -->

---
title: Writing an editor in less than 1000 lines of code, just...
description: Antirez (creator of Redis) built Kilo, a text editor in under 1000 lines of C code, without depending on ncurses, featuring syntax highlighting and search....
canonical: https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Writing an editor in less than 1000 lines of code, just for fun | daily.dev
og:description: Antirez (creator of Redis) built Kilo, a text editor in under 1000 lines of C code, without depending on ncurses, featuring syntax highlighting and search....
og:url: https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64
og:image: https://api.daily.dev/og/posts/rcz162G64.png
og:image:alt: Writing an editor in less than 1000 lines of code, just for fun
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing an editor in less than 1000 lines of code, just for fun

**[Lobsters](https://daily.dev/sources/lobsters)** · 5 min read · 0 upvotes · 0 comments

## Summary

Antirez (creator of Redis) built Kilo, a text editor in under 1000 lines of C code, without depending on ncurses, featuring syntax highlighting and search. Inspired by news about Nano leaving the GNU project, he hacked it together across two weekends by combining code from two prior toy projects: LOAD81 (a Lua environment for children) and linenoise. The editor uses VT100 escape sequences directly for terminal rendering. The project was purely for fun, celebrating the joy of small, purposeful programs.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <http://antirez.com/news/108>

## Questions this post answers

### How does the Kilo text editor work without ncurses?

Kilo renders directly to the terminal by sending VT100 escape sequences instead of using the ncurses library. It was built by combining code from two existing projects — LOAD81 (a Lua-based programming environment) and linenoise — and fits in under 1024 lines of C. It supports syntax highlighting and a search feature despite its minimal footprint.

_Developers building minimal CLI tools or studying terminal rendering track projects like Kilo on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 3 discussions and 293 comments across hackernews, lobsters (as of 2026-08-11).

**TL;DR:** Commenters are broadly impressed by the elegance and readability of a 1000-line C text editor built purely for fun, with many celebrating the joy of small purposeful programs; side threads spiral into vi vs. nano debates and VT100 terminal rendering techniques.

**Sentiment:** 72% positive · 20% mixed · 8% skeptical

**The case for**

- The code is genuinely human-readable C — not clever golfing — and the syntax highlighter is concise and declarative.
- Building without ncurses is seen as a feature, since ncurses adds little and can break in real-world terminal environments.
- The project is praised as a great example of hacking something together for fun without pressure of long-term use.
- Commenters shared their own similar small editors, suggesting the project inspired creative energy in the community.
- Antirez confirmed the total coding time was only ~6–8 hours across two weekends, which impressed many.

**The pushback**

- Some argue that without scriptability (like Vim, Emacs, or Sublime), such editors are "fairly useless" for real work.
- The syntax highlighter is a lexer, not a true parser, limiting its accuracy for complex languages like JavaScript or Perl.
- A few commenters pushed back on the "few hours" claim, questioning whether it was accurate or just self-promotion.

**By community**

- hackernews (positive): Overwhelmingly enthusiastic about the code quality, the fun spirit of the project, and the technical details of VT100 rendering — though threads quickly diverge into vi/nano debates and HTTP parsing tangents.
- lobsters (positive): Appreciative of the no-ncurses approach and the fun ethos, with several commenters sharing their own small editor projects as a direct response.

**Hottest debate:** Whether a sub-1000-line editor without scriptability has any practical value, or whether the entire point is that it doesn't need to.

**Open questions**

- Could this project serve as a TodoMVC-style benchmark for porting to Go, Rust, and other languages?
- How well would the simple lexer-based syntax highlighter scale to more complex languages like JavaScript or Perl?
- Would Windows 10's new VT100 support make this kind of terminal code portable to cmd.exe?

**Highlights**

> What challenges might you have if you wanted to implement something like this inside a game framework like Unity or MonoGame with C#, where it renders everything via DirectX or OpenGL?
> — [Dagwoodie on hackernews · 2 comments](https://news.ycombinator.com/item?id=12066906)

> Hello! It was a few hours (probably 6-8) across a total of two weekends (so a total span of 9 days where I did 2 "days" of work, 5 days of pause, 2 days of work).
> — [antirez on hackernews · 1 comments](https://news.ycombinator.com/item?id=12069510)

> Speaking HTTP is worse in almost every way to using CGI: harder to implement, loses meta information (suppose you put an application at /app/ on your server... CGI handles it well, HTTP doesn't unless you do some extension since your server will see GET / anyway) and is harder to centrally log too. I think app servers speak HTTP more because it is kinda convenient for developers to run the local server without setting up the http server.. convenience rather than superiority.
> — [destructionator on hackernews · 1 comments](https://news.ycombinator.com/item?id=12068635)

> I don't think he was trying to create a "useful" editor.
> — [tedu on lobsters · 16 points, 1 comments](https://lobste.rs/s/d4nhli/writing_editor_less_than_1000_lines_code#c_9q5exh)

> As an API, ncurses has very little to offer; it amounts to little more than a wrapper around the cursor & graphic manipulation codes on your terminal, with the added trick that it also works with glass terminals from the 70s (assuming your database of terminal incompatibility has the right entries, and the environment variable is set right..) I wrote my own editor which assumes a POSIX system and a terminal with a sane subset of ANSI standard escapes, or any terminal emulator not older than about 30 years.  The terminal handling code is around a dozen lines of C to manipulate the termios structure to disable canonical mode input processing, plus a handful of macro wrappers around the ANSI escapes, plus a few more to handle sigwinch. I really don't know why people always think "ncurses" when they see a TUI application.  It adds very little, and it breaks a lot.  Connect to an older solaris system while running rxvt-unicode.  Oh, everything is broken now?  Quick, find the terminfo file, compile it, put it in the right place (you know how to do all that, don't you?).. and then cry because "rxvt-unicode" is too long a string for that implementation to handle.  The fun thing is, if they assumed you support some standard escapes, most of the things would just work.
> — [inactive-user on lobsters · 1 points](https://lobste.rs/s/d4nhli/writing_editor_less_than_1000_lines_code#c_xsxmzu)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=12065217) · 535 points · 278 comments
- [hackernews](https://news.ycombinator.com/item?id=21749731) · 2 points · 0 comments
- [lobsters](https://lobste.rs/s/d4nhli/writing_editor_less_than_1000_lines_code) · 44 points · 15 comments

## Similar posts on daily.dev

- [Writing my own text editor, and daily-driving it](https://daily.dev/posts/writing-my-own-text-editor-and-daily-driving-it-5hnkcdhhx) · Hacker News · 2 upvotes · 0 comments
- [ZeroTUI Code Editor: Build Real Terminal Software, Not Just Terminal Screens](https://daily.dev/posts/zerotui-code-editor-build-real-terminal-software-not-just-terminal-screens-sahkt5wif) · Medium · 1 upvotes · 0 comments
- [Sick of AI Slop, Former Microsoft Engineer Built a New, AI-less Notepad](https://daily.dev/posts/sick-of-ai-slop-former-microsoft-engineer-built-a-new-ai-less-notepad-y2dpgwk2z) · It's Foss · 3 upvotes · 1 comments
- [Edlin on FreeDOS: When a simple line editor is all you need](https://daily.dev/posts/edlin-on-freedos-when-a-simple-line-editor-is-all-you-need-gmgiokavq) · All Things Open · 0 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c)

[View this post on daily.dev](https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Writing an editor in less than 1000 lines of code, just for fun","url":"https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64"},"datePublished":"2026-08-11T07:36:46.815Z","dateModified":"2026-08-11T07:37:35.273Z","description":"Antirez (creator of Redis) built Kilo, a text editor in under 1000 lines of C code, without depending on ncurses, featuring syntax highlighting and search....","image":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","thumbnailUrl":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Writing an editor in less than 1000 lines of code, just for fun"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/writing-an-editor-in-less-than-1000-lines-of-code-just-for-fun-rcz162g64#faq","mainEntity":[{"@type":"Question","name":"How does the Kilo text editor work without ncurses?","acceptedAnswer":{"@type":"Answer","text":"Kilo renders directly to the terminal by sending VT100 escape sequences instead of using the ncurses library. It was built by combining code from two existing projects — LOAD81 (a Lua-based programming environment) and linenoise — and fits in under 1024 lines of C. It supports syntax highlighting and a search feature despite its minimal footprint. Developers building minimal CLI tools or studying terminal rendering track projects like Kilo on daily.dev."}}]}
```

