How to write an editor

This page is a repository of resources making out a simple "HowTo Write your own editor ...". Use it wisely and please do not blame us if your spare time gets wasted on silly efforts trying to write yet another killer editor.

Most of the material here was found in the USENET group comp.editors which is a good place both to look and also to ask questions on just about anything concerning editing.

Another good place to look is Google, or dejanews.com, search for "buffer gap" or "How to write an editor". Last, but by no means least, we really recommend: The VI reference.

Below is a collection of postings on the subject:

Here are a couple of mirrored documents as well:

For those of you looking for a good++ book on the subject of editing and/or implementation details of editors I can recommend the (now out of print but) excellent book by Craig A. Finseth - The Craft of Text Editing. The whole book is now available directly on the author's web page.

When writing an editor you have to consider a few things: Do I really want to make everything from scratch (i.e. reinvent the wheel), which can (and IS) very interesting since there are many aspects to consider! Or do I want to write yet another useful graphical editor or IDE and put the real work in making out all the surrounding details? If you prefer the latter maybe some of these links, about creating editors or even complete environments using GTK+ and GNOME, will be more to your liking?

For more information on GTK/GDK/GLib and/or GNOME see those pages. Qt can be found on Trolltech's pages.

Now, if you don't want a graphical user interface, what should you use?

To see some man-pages, like curses, getch() etc., use the local