What Gary says is historically true, but I would point out that it was the fact that deep underneath vi was sitting on ed. Many full-screen versions of line editors, like teco, suffered from having their wings tied down close to the lowest assumptions and could not spread them and soar.

I remember the first time I used h to back up past the beginning of a line in Vim and fainted dead-away seeing the cursor reappear at the end of the previous line. I had been using Vim as a replacement for vi on Windows for a couple of years already before it happened. It's not that it's amazing functionality, it's that it was completely unexpected after a couple of decades as a vi jockey. Even today, I never really use that capability because somehow it just ain't vi, but I admit that it is the most natural thing in the world to do.

Starting in 1984 and for many years (until I lost the faith around the Mac OS 8 time frame) I had a parallel night life on the Macintosh and I long wanted an editor that supported the mouse the way I had come to expect on that platform plus all the plutonium-powered movement and text-editing commands of vi. For me, Vim has made good on this promise although I admit that I never actually block text with a click-and-drag except if I have to cooperate with another, broken application. Just being able to put the cursor using the mouse in moments where I seem to have gravitated to doing that has been bliss. With ctags and now an Intellisense-like capability, wow! And the best part of all is that it's on every platform I use (Linux, various Unices and Windows).

I love this Vim! It's God's own editor.



Gary Johnson wrote:
On 2006-11-15, Chuck Mason <[EMAIL PROTECTED]> wrote:

In gvim you can do i<Del><Esc> or 0i<BS> to join lines. So the need for
(J) is superfluous.  Why is there no antithesis to J for splitting
lines?

Because In The Beginning was Vi, and Vi viewed Files as consisting of sequences of Lines, each Line being a sequence of zero or more ASCII Characters ending in a Newline. Editing was done by manipulating lines and the characters _within_ lines; the terminating newline was never manipulated directly--the user didn't even have to know how lines were separated. You could split one line into two lines by typing Return or Enter in insert mode or replace mode, but the only way to join two lines into one line was to use the join command (:join or J).

This behavior was common in editors at the time. The model of treating a file as a single sequence of characters is more recent. Vim has added features to allow users to manipulate files in that manner if they choose, but these features have had to use the limited set of keys that were available after vi had defined most of them.

So, the reason for the J command was the necessity having such a command in a line-oriented editor, not to save key strokes. There was no need for a special command to split lines: typing Return or Enter already did that. (By that reasoning, one could argue that o and O are superfluous as well. I don't have a good answer for that, other than that inserting lines may have been considered by the designer of vi to be more common that splitting lines.)

HTH,
Gary

Reply via email to