An Editor that Skips to the End of a Def

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Tue Sep 25 03:13:47 CEST 2007

In message <slrnfff9op.1is.horpner at>, Neil Cerutti wrote:

> On 2007-09-22, Lawrence D'Oliveiro
> <ldo at geek-central.gen.new_zealand> wrote:
>> In message <5lhs4pF8bkunU1 at>, Bjoern
>> Schliessmann wrote:
>>> Nah. Use vim.
>> Every other text editor I have ever used understands that the
>> current position in a file is _between_ two characters (or
>> before the first character, or after the last character), not
>> _on_ a character. But not vi and its ilk.
>> Try the following in vi/vim: Move to some point in the middle
>> of a line. Press "i" to get into insert mode. Press escape to
>> get out again. You'll end up one position to the left of where
>> you were before. Press "i", and then escape again--you've moved
>> another position left. Why is it incapable of keeping track of
>> such a simple thing as your current position in the file?
> That's a silly question. Of course it knows your current
> position--it just chooses to modify your position when you exit
> insert mode.

That's like saying, about a program that, when given "2 + 2", outputs "5",
that _of course_ it knows the correct answer is "4", it just chooses
to "modify" the answer before outputting it.

Why does it "choose" to modify your position when you exit insert mode? Does
the phrase "broken as designed" mean anything to you?

>> Why does it need two different insert commands, "i" versus "a"?
>> Because one of them can't insert at the end of a line, and the
>> other can't insert at the beginning.
> i and a are two of *many* ways to enter insert mode.

Why do you need so many ways to enter insert mode?

>> And why have command-versus-insert mode at all? No other text
>> editor still surviving uses such an antiquated concept.
> The existence of command mode allows plain old keystrokes to be
> commands--it potentially makes commands easier to type.

And the downside is that the largest single proportion of those commands end
up being variations on "enter insert mode". Because most of the keystrokes
you enter during an editing session are in fact text to be input into the
file, not commands to manipulate that text. So in a modal editor, having to
jump in and out of insert mode all the time just adds to the number of
keystrokes you have to type.

More information about the Python-list mailing list