miscoranda: by Sean B. Palmer

Emano and Editing Trends

It's been just over a year since I wrote about emano, the text editor that I'm hacking on, but I'm still editing this entry in nano and not entirely enjoying the experience. Indeed, my development process for emano is such that I only work on it when I'm sufficiently annoyed with whatever editor I happen to be using at the moment—and I feel myself getting close to having another emano coding stint.

The next stage that I want to work on is organizing the code roughly as it'll be when I release it as a package, and doing more tests-driven coding, and more documentation. In other words, the things usually tacked on as an afterthought, but that really should be done whilst the coding is going on. The latest code isn't public because I haven't done the reorganisation yet, so that gives me more incentive to clean it up.

I've been using vi, or rather vim, a lot recently and working on some scripts for it—and it hasn't dissuaded me in the least from carrying on with emano. It has made me think about key bindings. The aim is to have the most useful set of key bindings, but since this varies across both person and even time it's nigh on impossible to reach the optimum.

But at least there seems to be a general tendency (or is this just me?) to invest too much time into setting up key bindings, macros, or other shortcuts that then deliver less than the investment. It's easy to learn a key combination, but it's not easy to have it become a reflex—it doesn't just take a long time, but messes you up until you've learned it.

I'd like to set up some kind of task analyser that measures the most frequent editing procedures that an individual takes, and then identifies the trends that, over time, would be the most effective to make shortcuts from. That way at least it wouldn't be random, and then the next step would be to measure what the all-important frequency threshhold is for shortcutising a procedure.

But that's a lot of work. The ghetto solution is to incorporate lots of tried and trusted key combinations from other editors. In nano, Ctrl+K is probably my most frequently used command (cut line to clipboard, appending to the clipboard if the line's been taken in sequence). In vi, I tend to use "Go" in normal mode quite often (go to the end of the document and then insert a new line below the current, i.e. last, line).

I prefer nano's reliance on a strong set of simple Ctrl mappings, but having one of those be a Ctrl+O vi simulation (i.e. do a single command in normal mode), might be a good idea. It's a shame that Ctrl is a bit awkward on Apple laptops—perhaps there's a way to bind to the Apple command key. As for emacs's Ctrl+backsplat+wacky+boombox combinations, I figure I'd like to foist various stuff onto programmable Alt combinations. So you'd have a set of Alt+keyname combinations, and then you could use Alt+number to switch between them, or some such contrivance.

I'd also investigate having the default Alt bindings be slightly vi like. For example, Alt+l could be yank line; Alt+p yank paragraph; Alt+o append a new line below the current line. Obviously, I like the vi mentality but I really despise modes. And I like emacs's power but I really despise clutter. And I really like nano's robustness, but I really despise its spartanity. I'd really like emano to sit in the middle of those three editors, perhaps with some throw-in features from the less well-known, more exotic editors.

by Sean B. Palmer, at 2006-01-03 19:45:12. Comment?

The Nibtrick Penomenon · The Floredelise

Sean B. Palmer