I think Casey is misconstruing the notion of 'modal editor', and sadly, nobody pointed it out to him.
I have written a longer post about it but it was lost due to some error during posting - so this time around I will just post a link to an article describing how modal editors (well... at least vi) work:
I just don't think that Casey's approach of just mapping emacs keybindings into 'modes' without making vi-style DSL for text-object manipulation out of them will lend itself to pleasant editing experience.
At the moment, it's less about misconstruing the meaning of modal editing and more just me trying to have a modal thing that is the same as the way I used to use Emacs. And I've basically got that, so that's a good thing (TM).
However, I definitely agree that now that I've made the leap, I should go ahead and try to go a bit further and get some of the nice VI editing power. I haven't had a chance to study it enough to really get how it all works yet, but I will try to do so over time!
*hehe* vi the is best god-awful editor you will ever use
The only reason I went through the pain of learning it was the fact that it was
a) Installed on almost every *nix version I ever worked on
b) Would work on the nastyest crustyest dumb terminal that has every been made
which was a requirement when stuck in a machine room with a dead machine
at 3am and the only thing you could find to connect to the serial console
was the mankyest dumb terminal that no one else wanted and thus was on
the DC crash cart
Not a good reasons to use an editor these days I'll admit; but back when dinosaurs ruled the earth it made sense :)
Just realised that my last post made it sound like I don't like vi ... In fact I do & it's still my go to editor of choice.
If you want to look at one of the nice features and one of my personal favourites is the :% command as it allows a regex/sed style editing along the lines of
:%s/some text/other text/g
which does as expected a replacement of some text with other text globally in the file; this on its own is worth the price of admittance
other handy ones are
the dot command will repeat any command, use / to find and n to find next
the ability to put a number in front of a command is also nice
where dd deletes a line so 99dd will delete 99 lines
then navigate to the desired location in the code and p to paste it in
use yy to yank a line into the cut/paste buffer
Not sure if any of that is something that would fit with what you want in 4coder, but a regex engine as ugly and nasty as they are, are definitely useful additions
Casey, I know what you are trying to do, it's just that I'm surprised that it had worked for you as well as it did. If I had to think about which mode I'm in (fancy visual indicator notwithstanding), it would drive me nuts. Maybe it's not such an issue for you.
Regardless, here are some thoughts about the differences between modal and non-modal editors. Maybe it will be useful to you:
In Emacs you do (as far as I understand) a "mark, move, command", while in VI it is a "command, move", and the (conceptual) mark is set implicitly to the cursor starting position. The advantages of it being:
-you hardly ever need to place marks (although they are still useful for jumping inside, and between files)
-It is a more natural way to think about edits. "Delete from here to there" instead of "From there to here delete".
On the downside are... well... the modes, or - to be more precise - the need to quit the insert mode after typing in some text. On the flip side, it also makes the edits transnational, and hence repeatable (the ubiquitous '.' command).
Some modal editor niceties (in the decreasing order of importance):
1. The ability to move the cursor between interesting places in the text as a single motion is the key feature of modal editors (e.g: "2w" - move 2 words forward, "3Fx" - move 3 occurrences of 'x' backwards, '}' - move to the end of the block, '/Foo' - find "Foo" and move to it, and so on).
2. Many commands should do something, and then drop you into the insert mode (e.g: 'c' - change, 'a' - append, 'I' - insert at the beginning of the line, 'A' - append to the current line, and so on).
3. Text-objects: instead of looking for one interesting location in the text as a command's argument - look for two, around the cursor. Making the editor aware of concepts like function arguments, code blocks, and so on, is an awesome thing. Making it fully AST-aware would be more awesome still.
4. Vim's visual block mode is great. You can not only delete, but also prepend/append to a whole block of text at once. Way better than those pesky keyboard macros, if you can get away with it.