small yet mighty GNU Emacs style editor

Kevin Bloom d4058373b2 fixed implicit definition warning il y a 7 heures
docs 0814b08507 Revert "moved term variable to better location" il y a 3 mois
scripts bcf62ed22a Revert "fixed some path-related issues with git scripts" il y a 1 semaine
.gitignore 80fa94f2c1 use spaces instead of tabs il y a 1 an
AE_LICENSE e97a1e4a48 licenses il y a 2 ans
BSD_LICENSE df27f03f75 update date il y a 1 mois
LICENSE df27f03f75 update date il y a 1 mois
NEWS d31520e44a fixed endless loop on delete-between il y a 7 heures
README.md b8c6d6681a added some more information about bugs to docs il y a 1 semaine
ait.1 b8c6d6681a added some more information about bugs to docs il y a 1 semaine
buffer.c e5f36016eb fixed msgline bug with blanking out after last few commits il y a 2 semaines
command.c d4058373b2 fixed implicit definition warning il y a 7 heures
complete.c 5614ff25b3 fixed some warnings on linux il y a 1 semaine
display.c 4b6d8bd89b fixed slowness in rendering due to syntax highlighting il y a 3 jours
gap.c 766d27ea59 don't set the undo if there is no buffer il y a 1 semaine
header.h 4b6d8bd89b fixed slowness in rendering due to syntax highlighting il y a 3 jours
hilite.c 4b6d8bd89b fixed slowness in rendering due to syntax highlighting il y a 3 jours
key.c d5c8b83ad7 fixed another memory bug with clipboard il y a 6 jours
main.c d5c8b83ad7 fixed another memory bug with clipboard il y a 6 jours
makefile 21ebd87d93 used the wrong function... il y a 2 semaines
replace.c 48a0378c8a fixed syntax getting messed up on ending search/replace commands where page is inside of a multiline comment il y a 1 semaine
search.c 4b6d8bd89b fixed slowness in rendering due to syntax highlighting il y a 3 jours
shell.c e6da7827a0 fixed bline getting messed up after shell commands il y a 2 semaines
syntax.h 877684830b better ledger negatives il y a 5 jours
termbox.h 56e5092eee Closes #40 il y a 1 mois
unicode.h 7e13e331c0 fixed remaining issues with unicode il y a 1 an
util.c 37cf284905 fixed crash on non-syntax files il y a 1 mois
util.h b1eb94013f added variable exclusions to add lisp syntax il y a 1 mois
window.c 14ed565fa4 fixed some memory bugs il y a 2 semaines

README.md

ait - small yet mighty GNU Emacs style editor

ait is inspired by GNU Emacs, acme, mle, microEMACS, mg, and vi/vim/neovim. 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 at this point it only works on GNU/Linux (glibc & musl), macOS, FreeBSD, OpenBSD, and NetBSD. Note that ait is primarily used on GNU/Linux (glibc), NetBSD, and macOS so support on other systems may vary.

Features

  • Emacs-like keybindings (see key.c)
  • basic window/buffer support
  • isearch
  • find/replace
  • M-x to run shell commands
    • shell commands are either inserted at the point or replace the region. For example, if you ran the scripts/spell command on a word, it would replace the word.
  • M-o to open files with external command
  • basic unlimited undo/redo
  • keyboard macros
  • jump/zap to char
  • bracket highlighting
  • syntax highlighting (see buffer.c & hilite.c & syntax.h)
  • quick jump to line and word (similar to avy)
  • UTF-8/Unicode Support
  • GNU Emacs-like kill ring

Goals

  • simplicity but don't suck
  • portability
  • reasonably small
  • support the most important core GNU Emacs keybinding
  • UTF8 & unicode
  • don't reinvent the wheel
  • don't be total trash

Non-goals

  • customizability
  • extension language
  • be Emacs
  • be Vim
  • IDE-like features
  • rewriting things that work

Abstract

The purpose of this editor is to be similar enough to Emacs but without the extra stuff. It focuses on using the existing system to do things, and having smaller footprint without lacking in important editor features. To do this, most of the keybindings are the vanilla Emacs bindings with a few exceptions, having similar buffer and cursor controls, and having a familiar look. Instead of rewriting everything in C, ait allows you to use shell commands as an pseudo-extension language. See scripts/ for more information.

The codebase comes from 2 other authors, most of which was written back in the 90s. That being said, some of the code is clearly outdated but since it works, I have no desire to rewrite it. There is also no reason for me to support things that I don't actually use or things that can easily be done using an existing function. For example, multiple cursors is really great but a complicated feature to add when most situations can be solved using keyboard macros.

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. I thought about calling it simply At but there is already a program called at1 2 3 4 5. My wife also came up with the name of aint, standing for Atto IN Termbox and having the catch phrase of "because it ain't your editor."

Derivation

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 issues.

Copying

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.

Acknowledgements

Hugh Barney for writing Atto.

Anthony Howe for writing Anthony's Editor.

GNU Emacs for keybindings, power, and inspritation.

Plan 9's acme for inspiration.

mle for inspiration and guidance.

Termbox2 for being nice.

Adam Saponara for making the previous 2.