Started working on a text editor a little while ago. I always wanted to write my own text editor, but seemed to lack the inspiration to get me started. Then I discovered emano by Sean B. Palmer and I finally managed to convince myself that it actually might not be that much work.
Ni can probably be best described as a programmer’s code editor framework in the making. I started from scratch and I’m trying to get the different components that make up an editing environment abstracted to the point that you can easily build editor interfaces on top of this common codebase. The idea is that I can get to the point where I can play around with different user interface ideas without reinventing the wheel every time. Everything is written in Python.
As a kind of “reference implementation” I’m building a term editor first using urwid. After this I’m planning to build a GTK/GNOME editor that will probably not use gtksourceview, but something like pango and cairo directly. I wrote some more about this that I’ll put up somewhere shortly, but basically gtksourceview is already an editor imho, so using it approaches the problem from the wrong way around. Think of ni as a modern-day Emacs or VIM where you can use it from the terminal or a GUI.
What’s done so far? I’ve got the basic code structure going, but I’m constantly refactoring, so this is likely to change. You can create documents, switch between them, load them, save them and close them. There are some basic dialogs - so far only the type that runs in that status-line at the bottom of your typical term editor. Syntax highlighting using pygments (had to do some interesting hacks to only lex and display parts of the document at the time to boost efficiency), undo, redo, make selections by holding down shift, cut, copy, paste selections using ctrl-x, ctrl-c and ctrl-v, delete selections, navigate around using the keys, home, end, page-up, page-down.
The main features the term interface is still lacking in my opinion are auto-indent, a document list dialog/window and find/replace. Apart from that I think the term interface can do with some minor improvements like visually indicating if I file has unmodified changes.
I’m getting a lot of inspiration from JEdit. JEdit’s hypersearch find/replace is absolutely amazing and I plan to mimic that. Also, I’m trying to use the same key bindings as far as possible, but some just don’t seem to work in a terminal.
After this I’m starting on a GTK/GNOME based interface, but ultimately there should be no reason why there can’t be a QT/KDE one, a Mac OS X one, a Windows one, etc.
Will put up a project page and bazaar branch shortly!