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:
- Writing an editor
- Information on editor internals
- Cont. of editor internals
- [Q] C tutorial book; writing an editor was the focus
- Some other information of interest
- Information about termios
- Implementing Undo for Text Editors
- VI Design
- VI vs. Emacs
- Quoting in VI
Here are a couple of mirrored documents as well:
- Buffer Gap By the author of JOVE. Local mirror.
- Editor implementation discussed by the famous Joseph H. Allen, author of JOE. Local mirror.
- More interesting well worthwile reading material. Local mirror.
- Nice book about data structures for text sequences.
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?
- GtkEditor Widget reference
- Scintilla, a free source code editing component.
- Qt and Xt editor example
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
- man2html script or the local
- Debian WWW-gateway.