Text File

Aucb.119 fa.editor-p utzoo!decvax!ucbvax!C70:editor-p Mon Dec 7 12:18:04 1981 Insert Mode >From LAWS@SRI-AI Mon Dec 7 11:35:28 1981 One of the advantages of an explicit insert mode is that you can get it in several flavors. Aside from the usual insert before and append after distinction, you can also enter an insert mode to

Skip to the start (end) of the line and insert.

Add a new line ahead of or after the one the cursor is on.

Replace (overwrite) characters until the mode escape is typed. This is very handy for editing formatted material.

Replace or insert a single character.

Replace (or, in VI, "change") a word or other unit. Very handy. A count can also be specified.

Replace (or substitute) up to (or including) a specified character.

Replace to the end (or back to the start) of the line.

Erase the entire line and enter insertion mode to replace it.

VI manages to offer all of these options (except insert single character) using only a few keys. I find cw and C (change word and change to end of line) to be among my most used commands.

Another feature of an insert mode, although of debatable value, is that deletions can be limited to the text just inserted. VI enforces this distinction between ordinary text deletion and insert-mode deletion of the just-inserted text. I suppose the reason is to permit Control-U, the whole-line erase character, to delete just the new text.

-- Ken Laws -------

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> of http://communication.ucsd.edu/A-News/

This Usenet Oldnews Archive article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.