vi.doc
资源名称:calvin23.zip [点击查看]
上传用户:dfpj888
上传日期:2007-01-05
资源大小:100k
文件大小:23k
源码类别:
编辑器/阅读器
开发平台:
DOS
- calvin(1) MS-DOG programmer's manual calvin(1)
- ------------------------------------------------------------
- -- Calvin version 2.2. --
- -- Copyright 1988, 1989, 1990, 1992, 1993 by Paul Vojta. --
- -- This program may be freely distributed provided: --
- -- --
- -- 1. All files (vi.exe, vi.doc, and read.me) are --
- -- distributed together in unmodified form (use of --
- -- universally available file compression software --
- -- is allowed, however); and --
- -- --
- -- 2. No fee is charged other than a nominal processing --
- -- charge or a connect time charge. --
- ------------------------------------------------------------
- (Earlier versions of Calvin have been released under the name
- "Free VI.")
- SYNOPSIS
- vi file ...
- vi +[number] file ...
- vi +/pattern file ...
- Wild cards may be used on the command line.
- Calvin also supports the EXINIT environment variable, which may contain
- :set commands (put spaces in place of equals signs).
- DESCRIPTION
- Calvin is a screen text editor written for the IBM PC. It implements
- a subset of the Unix screen editor vi(1). Users familiar with Unix can
- skip to the command summary at the end of this file. (Unix is a
- trademark of Bell Laboratories.)
- This editor requires MS-DOS 2 or higher and 128K of memory. It will
- use all available memory for storing the file, etc.; optionally, it can
- store additional information on disk.
- It supports EGA 43-line and VGA 50-line modes.
- INSTALLATION
- Installation is fairly straightforward; you should copy vi.exe into
- some directory mentioned on your PATH command.
- There is one catch, however. If you want Calvin to use the disk to
- store information which does not fit into memory (i.e., long files),
- then you should tell it which drive and directory to use. This can be
- done at any time using the :set directory command (see below).
- However, if you edit long files often, it would perhaps be most
- convenient to always set it when Calvin starts up. This can be done by
- the DOS command line
- set EXINIT=set directory c:/tmp
- if, for example, you wanted to use c:/tmp as the temporary directory.
- This line can also be placed in the autoexec.bat file.
- GETTING STARTED
- To edit an existing file, type
- vi name
- as a DOS command. The first few lines of the file will then appear on
- the screen, and you may use any of the editing commands to modify it.
- For example:
- dw delete a word
- de delete a word, leaving punctuation
- dd delete a line
- 3dd delete three lines
- itext<End> insert text (note that <End> refers to the "End"
- key on the numeric keypad)
- /string search for string
- xp transpose characters (actually two commands)
- In addition, all of the keys on the numeric keypad perform as labeled.
- When you are finished editing, type ZZ or ":x" to write the corrections
- to disk and quit. If no corrections were made, then ZZ just quits. To
- quit without saving corrections, use ":q!".
- If the file named in the DOS command "vi name" does not exist, Calvin
- starts with an empty file, into which text can be inserted. This is
- how Calvin can be used to create a file.
- EDITOR MODES
- Calvin has three modes, all of which occur in at least one of the above
- commands. They are,
- o Command mode. This is the normal and initial state. All commands
- return here after completion.
- o Insert mode. Characters typed in insert mode are, as the name
- implies, copied into the file instead of interpreted as commands.
- The "Escape", "End", and "Insert" keys return Calvin to command
- mode (and vice versa for "Insert"). In this mode the cursor is
- larger than in command mode, in order to help you keep track of
- the program's mode.
- o Last line mode. In this mode the editor is reading text for a ":"
- command or a "/" or "?" search. The text ends with <cr> or
- "Escape". Control-U deletes the text but not the ":", "/", or "?"
- (unless there is no text).
- COUNTS BEFORE EDITOR COMMANDS
- Many Calvin commands can be preceded by a number. The effect of this
- number is usually to repeat the effect of the command. Sometimes,
- however, it has other meanings. In many cases it is ignored.
- THE SCREEN
- Most of the screen is used to display the file; the last line is used
- for last line mode and for messages. Lines past the end of the file
- appear as lines consisting of a single tilde ("~"). Tabs are expanded
- to columns 9, 17, 25, ... (although this can be changed). Long lines
- are wrapped around, so that they may take up several lines of the
- screen. "@" lines indicate that the next line is too long to fit on
- the remainder of the screen. The user should not create lines too long
- to fit on a screen, although Calvin will not stop him or her from
- trying.
- In case DOS (or a program bug) scrambles the screen, ^L (Control-L)
- will restore it to what it should be.
- If a command causes the cursor to move to a part of the file which is
- not currently displayed on the screen, Calvin will automatically scroll
- as necessary. Calvin also has commands to explicitly request scrolling:
- ^F or PgDn Move the screen Forward one screenful, keeping the last
- two lines of the old screen as the first two lines of
- the new.
- ^B or PgUp Move Backwards one screenful.
- ^D Move Down 1/2 screen.
- ^U Move Up 1/2 screen.
- ^E Move Down one line.
- ^Y Move Up one line.
- MOTION COMMANDS
- The arrows on the numeric keypad perform as labeled. Also, Calvin has
- a rich assortment of other commands to move the cursor. These are:
- + or <cr> Move the cursor to the first nonblank character of the
- next line in the file. (All motions referring to lines
- put the cursor on the first nonblank character of that
- line.)
- - Move to the previous line.
- $ Move to the end of the current line.
- 0 Move to the beginning of the line.
- fx Find the next occurrence of the given character. The
- search is limited to the current line.
- Fx Same as fx, backwards.
- ; Repeat the previous f or F.
- /string<cr> Search for the next occurrence of the given string.
- This search starts at the current position, but may
- wrap around the beginning of the file.
- ?string<cr> Same as "/", searching backwards.
- n Repeat last "/" or "?" search.
- N Same as "n", in the opposite direction.
- H or Home Move the cursor to the first line of the screen.
- M Move to the middle line of the screen.
- L or End Move to the last line of the screen.
- nG Move to the <n>th line of the file.
- G Move to the last line.
- % Move to the matching parenthesis, bracket, or brace.
- SEARCHING
- The backslash character `' has a special meaning in strings used for
- searching. Generally, it either adds or removes special meaning to or
- from the following character. Currently, this means that