A couple of weeks ago there was this news that the tiny cool program named Nano editor is no longer under the GNU project umbrella. It was a part of a terminal-based email client and for many people it acted as the first code editor. Though these days’ people are busy creating complex and longer codes, there is one who still admires small codes. So, just by getting inspired by Nano editor, someone decided to code his own editor that is way smaller than Nano itself.
Named Kilo, this editor is the brainchild of Salvatore Sanfilippo. The reason behind the name is that Kilo has less than 1024 lines of code (counted with cloc). Using the code from his other two projects, load81 and linenoise, he wrote the code. The project is currently in alpha.
“The “cloc” utility, used in order to count the number of lines of code, signaled me I still had ~100 lines of space before reaching 1024 LOC, and a serious editor needs a “search” feature after all. So back to the code, trying also to restructure and recomment it a bit, since you know, when you mix two projects pieces in a few hours the risk is that the code quality is less than excellent,” Sanfilippo wrote in a blog post.
The screencast is available for those who are interested. Instead of depending on some library or courses, Kilo makes use of standard VT100 escape sequences. The code is available on GitHub. Sanfilippo inspires people to use it as a starting point to write their own editors.