What does HackerNews think of kilo?

A text editor in less than 1000 LOC with syntax highlight and search.

Language: C

Yeah, "micro" for an editor would be 11 kilo bytes. I bet it's possible to do a half-decent editor in C in 11KB. Antirez's "kilo" (~1000 lines of C) is 36KB when compiled with standard gcc (https://github.com/antirez/kilo).

That said, for many server-type use cases these days, 11MB isn't a huge deal. Still, I wonder if micro could be compiled on / ported to TinyGo and end up a few hundred KB? It looks like TinyGo can produce some pretty small binaries: https://tinygo.org/docs/guides/optimizing-binaries/

Anyone interested in the machinations of all of this terminal stuff should look at antirez’ kilo, a terminal text editor in under 1000 lines of code: https://github.com/antirez/kilo

There is a nice tutorial that walks through how one might write it from scratch: https://viewsourcecode.org/snaptoken/kilo/

You could start by looking at something super simple like Kilo:

https://github.com/antirez/kilo

Even I could understand this one pretty well and that's no small matter.

Lately, I've been playing with the idea of combining tmux, nano or purpose-built kilo editors[0], fff [1] or slmenu [2][3], and kanban.bash [4] into my own little "agile" terminal IDE.

[0] https://github.com/antirez/kilo

[1] https://github.com/dylanaraps/fff

[2] https://www.youtube.com/watch?v=SlJto75auCA

[3] https://github.com/joshaw/slmenu

[4] https://github.com/coderofsalvation/kanban.bash

In the same vein there's kilo by antirez:

https://github.com/antirez/kilo

Edit: oops, yours is in assembly, so definitely not in the same vein :-p (except for both trying to be small!)

Edit2: ... and, the article is about kilo. D'oh. This is what happens when you go first through HN comments, only to later open the article (which I do often!).

Well, it seems we've already skipped to kilo[1], so it'll have to be mega.

1: https://github.com/antirez/kilo

https://github.com/antirez/kilo

A text editor by the guy that made redis, in less than 1000 lines and a lot of comments.

Kilo is a great way to learn how to manipulate the terminal directly (rather than using a wrapper library like ncurses): https://github.com/antirez/kilo (A text editor in less than 1000 LOC with syntax highlight and search.)
It shouldn’t be too hard: [kilo](https://github.com/antirez/kilo), the editor on which this is partially based, is modeless. All of the modes are thus addons that I’ve built. You’d have to tweak a bit of the code to make it usable as a modeless editor, but it could definitely work!
I'm teaching myself C (pure hobby) and I really liked these codebases:

https://github.com/antirez/kilo

https://github.com/meetecho/janus-gateway

The obvious caveat here is that I have no idea what makes a good C codebase. What I liked in both was I was able to:

compile and run them easily

make tiny changes and observe them easily

read and understand a reasonable portion of them

enjoy the odd comment here and there

Kilo's supported commands are[1]:

  CTRL-S: Save
  CTRL-Q: Quit
  CTRL-F: Find string in file (ESC to exit search, arrows to navigate)
It's available in a lot of well-used distros: https://pkgs.org/search/kilo but doesn't look like it's in Arch, etc.

Kilua looks cool also as it has more similar keybindings to Emacs[2]:

  Ctrl-x Ctrl-o Open a new file in the current buffer.
  Ctrl-x Ctrl-s Save the current file.
  Ctrl-x Ctrl-c Quit.
  
  Ctrl-x c      Create a new buffer
  Ctrl-x n      Move to the next buffer.
  Ctrl-x p      Move to the previous buffer.
  Ctrl-x b      Select buffer from a list
  
  M-x           Evaluate lua at the prompt.
  Ctrl-r:       Regular expression search.
but the goal would be to have that available in a package manager in a default install, so that after logging into any server where I'm a sudoer, I could:

  sudo apt-get install some_package
  sudo yum -y install some_package
  pacman -S some_package
  ...
[1]: https://github.com/antirez/kilo [2]: https://github.com/skx/kilua
And kilo[1] is 28k but it doesn't have as many features. Also a "keyboard" vs "keystroke" editor, editors built before ginormous keyboards became ubiquitous use various keystrokes for commands, ones that came to exist in an assumed presence of a ginormous keyboard use special keys for commands. (example, if the only way to move the cursor up in your editor is the cursor up arrow key, you are a "keyboard" based editor. Not that either choice is better or worse just something I find an interesting distinction.

[1] https://github.com/antirez/kilo