A simple, portable, and small GNU Emacs style editor

Kevin "The Nuclear" Bloom bedf6dd6f5 M-i for tab, C-i for 2 space 6 hours ago
docs 6a89799bc8 init 5 months ago
.gitignore 13f2893864 Add '.gitignore' 5 months ago
AE_LICENSE e97a1e4a48 licenses 2 months ago
BSD_LICENSE e97a1e4a48 licenses 2 months ago
LICENSE df3f388468 fixed a few things 2 months ago
README.md 59ffdd4bc3 updated readme 2 months ago
TODO.md 3771b9f60b always use the editor's directory for pick command 3 days ago
buffer.c 848b963e42 kept original next-buffer function 2 months ago
command.c bedf6dd6f5 M-i for tab, C-i for 2 space 6 hours ago
complete.c 7b1257fb29 buffer switching 2 months ago
display.c 215fbfbd0a fixed bug with large paths causing crash 3 days ago
gap.c 9e8d233e36 save ~ backup files 2 months ago
header.h bedf6dd6f5 M-i for tab, C-i for 2 space 6 hours ago
hilite.c ed632515df fixed undo and actually made it pretty nice 2 months ago
key.c bedf6dd6f5 M-i for tab, C-i for 2 space 6 hours ago
main.c 14b51dae69 started on kbd macro 3 days ago
makefile 7119a34736 can input shell commands, can only open files with commands 3 days ago
replace.c 48818e432b highlight current match with query-replace 2 months ago
search.c ee5d37278f case sensitivity if upper case char is in search 2 months ago
sent 14b51dae69 started on kbd macro 3 days ago
shell.c 7119a34736 can input shell commands, can only open files with commands 3 days ago
termbox.h bc2fea4102 can actually do minor edits now 2 months ago
util.c c4efcab1e9 fixed bracket matching breaking empty buffer rendering 2 months ago
util.h 0a2b5b4780 highlight matching bracket 2 months ago
window.c 6bc11962fb highlight all search matches 2 months ago


Ait - a simple, portable, and small GNU Emacs style editor

Ait is inspired by GNU Emacs and mle. Based on Atto. Started as a fork of Atto but was then ported to Termbox2 to become what it is now. Ait can be compiled with no dependencies other than libc. It should work on all unix-like systems although I've only tried it on MacOS and NetBSD.


  • suckless simplicity
  • portability
  • reasonably small
  • support the core GNU Emacs keybinding
    • this excludes special non-editing related bindings such as C-x d, for dired.
  • UTF8
  • don't suck


  • customizability
  • extension language
  • be Emacs
  • be Vim
  • IDE-like features

Future Goals

Once Ait completes the above goals and does them well, there are a few other goals that I'd like implement.

  • Plan-9 acme style string execution
    • termbox supports mouse but I'd focus on keyboard-based execution
  • Syntax highlighting
    • Ait would likely not contain any modes for this in the core project other than C and POSIX shell
  • Editor control via external programs (no idea if this is possible)
    • I'd like to allow users to write programs that can be used to control ait. For example, imagine writting a program in shell, C, lisp, haskell, whatever and having it be used as an extension to the editor.
    • This would keep the editor code clean and simple (hopefully) and leave all the extension work to other things.
    • String execution can only do 2 things, mostly
    • modify text such as using perl to parse something
    • output text such as running ls or compiling something
    • Editor Control would allow you to have control of the cursor, buffers, windows, printing stuff, etc.

Why the name Ait?

Ait stands for Atto In Termbox or Atto Implemented in Termbox. Also, an ait is a small island usually found in rivers.


From Atto's README: "Atto is based on the public domain code of Anthony Howe's editor (commonly known as Anthony's Editor or AE, [2]). Rather than representing a file as a linked list of lines, the AE Editor uses the concept of a Buffer-Gap [4,5,6]. A Buffer-Gap editor stores the file in a single piece of contiguous memory with some extra unused space known as the buffer gap. On character insertion and deletion the gap is first moved to the current point. A character deletion then extends the gap by moving the gap pointer back by 1 OR the gap is reduced by 1 when a character is inserted. The Buffer-Gap technique is elegant and significantly reduces the amount of code required to load a file, modify it and redraw the display. The proof of this is seen when you consider that Atto supports almost the same command set that Pico supports, but Pico requires almost 17 times the amount of code."

Ait comes from Atto so the derivation is trival. I just ported it to termbox and started hacking in my own changes for fun.

Known Issues

  • See TODO.md


Ait code is released under the BSD 3-Clause License. Atto code is released to the public domain. Anthony's Editor code claims to be public domain but contains a questionable (see AE_LICENSE) license that isn't actually public domain. See the LICENSE file for the offical statements.


Hugh Barney for writing Atto. Anthony Howe for writing Anthony's Editor. GNU Emacs for keybindings, power, and inspritation. mle for inspiration. Termbox for being nice. Adam Saponara for making the previous 2.