Vi Reference - patch 3 (follows patch 1)
Maarten Litmaath
maart at cs.vu.nl
Thu Aug 24 06:11:32 AEST 1989
(Patch 2 was `internal'.)
To Eamonn: I can't reach you or what?! Could you send me a UUCP bang path?
Enjoy.
: This is a shar archive. Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'vi.ref.diff'
sed 's/^X//' > 'vi.ref.diff' << '+ END-OF-FILE ''vi.ref.diff'
X*** vi.ref Wed Aug 2 19:06:32 1989
X--- vi.ref.new Wed Aug 23 19:44:51 1989
X***************
X*** 2,7 ****
X--- 2,12 ----
X / VI REFERENCE (by maart at cs.vu.nl) /
X ////////////////////////////////////////////////////////////////////////
X
X+ Warning: some vi versions don't support the more esoteric features described
X+ in this document.
X+ You can edit/redistribute this document freely, as long as you don't make false
X+ claims on original authorship.
X+
X default values : 1
X ^X : <ctrl>x
X [*] : * is optional
X***************
X*** 11,17 ****
X <lf> : linefeed
X <ht> : horizontal tab
X <esc> : escape
X! <del> : delete
X <a-z> : an element in the range
X N : number (* = allowed, - = not used)
X CHAR : char unequal to <ht>|<sp>
X--- 16,24 ----
X <lf> : linefeed
X <ht> : horizontal tab
X <esc> : escape
X! <erase> : your erase character
X! <kill> : your kill character
X! <intr> : your interrupt character
X <a-z> : an element in the range
X N : number (* = allowed, - = not used)
X CHAR : char unequal to <ht>|<sp>
X***************
X*** 75,81 ****
X
X ^] | search in the tags file where the function under the
X | cursor is defined (file, line) and go to it
X! :[x,y]g/<string>/<cmd> | search globally [from line x to y] after <string>
X | and execute the "ex" <cmd> on each occurrence
X
X ///////////////////
X--- 82,88 ----
X
X ^] | search in the tags file where the function under the
X | cursor is defined (file, line) and go to it
X! :[x,y]g/<string>/<cmd> | search globally [from line x to y] for <string>
X | and execute the "ex" <cmd> on each occurrence
X
X ///////////////////
X***************
X*** 134,142 ****
X * | << | shift <*> lines one shiftwidth to the left
X * | . | repeat latest command <*> times
X
X! /////////////////////////////////
X! / changing text (end with <esc> /
X! /////////////////////////////////
X
X * | r<char> | replace <*> chars by <char> - no <esc>
X * | R | overwrite the rest of the line, append <*> - 1 times
X--- 141,149 ----
X * | << | shift <*> lines one shiftwidth to the left
X * | . | repeat latest command <*> times
X
X! //////////////////////////////////
X! / changing text (end with <esc>) /
X! //////////////////////////////////
X
X * | r<char> | replace <*> chars by <char> - no <esc>
X * | R | overwrite the rest of the line, append <*> - 1 times
X***************
X*** 154,159 ****
X--- 161,182 ----
X - | & | repeat latest "ex" substitute command, e.g.
X | ":s/wrong/good"
X
X+ Substitute replacement patterns.
X+
X+ The basic metacharacters for the replacement pattern are `&' and `~'; these
X+ are given as `\&' and `\~' when nomagic is set. Each instance of `&' is
X+ replaced by the characters which the regular expression matched. The meta-
X+ character `~' stands, in the replacement pattern, for the defining text of
X+ the previous replacement pattern.
X+ Other metasequences possible in the replacement pattern are always introduced
X+ by the escaping character `\'. The sequence `\n' (with `n' in [1-9]) is
X+ replaced by the text matched by the n-th regular subexpression enclosed between
X+ `\(' and `\)'. The sequences `\u' and `\l' cause the immediately following
X+ character in the replacement to be converted to upper- or lower-case
X+ respectively if this character is a letter. The sequences `\U' and `\L' turn
X+ such conversion on, either until `\E' or `\e' is encountered, or until the end
X+ of the replacement pattern.
X+
X //////////////////////////////
X / remembering text (yanking) /
X //////////////////////////////
X***************
X*** 181,197 ****
X | (there must be no other chars on the line)
X ^^D | idem, except that it is restored on the next line
X ^T | one shiftwidth to the right
X! ^H | one char back
X ^W | one word back
X! ^U | back to the begin of the change on the current line
X! | (generally your kill char)
X! <del> | like <esc>
X
X /////////////////////////////////////////////////
X / writing, editing other files, and quitting vi /
X /////////////////////////////////////////////////
X
X! :q | quit vi after writing
X :q! | quit vi without writing
X :w | write the file
X :w <name> | write to the file <name>
X--- 204,219 ----
X | (there must be no other chars on the line)
X ^^D | idem, except that it is restored on the next line
X ^T | one shiftwidth to the right
X! ^H | <erase> | one char back
X ^W | one word back
X! <kill> | back to the begin of the change on the current line
X! <intr> | like <esc>
X
X /////////////////////////////////////////////////
X / writing, editing other files, and quitting vi /
X /////////////////////////////////////////////////
X
X! :q | quit vi, unless the buffer has been changed
X :q! | quit vi without writing
X :w | write the file
X :w <name> | write to the file <name>
X***************
X*** 227,234 ****
X ^L | refresh the screen (sometimes "^P" or "^R")
X ^R | sometimes vi replaces a deleted line by a '@', to be
X | deleted by "^R" (also with option 'noredraw')
X! [*]^E | scroll <*> lines downward
X! [*]^Y | scroll <*> lines upward
X [*]^D | scroll <*> lines downward
X | (default the number of the previous scroll;
X | initialization: half a page)
X--- 249,258 ----
X ^L | refresh the screen (sometimes "^P" or "^R")
X ^R | sometimes vi replaces a deleted line by a '@', to be
X | deleted by "^R" (also with option 'noredraw')
X! [*]^E | expose <*> more lines at bottom, cursor stays put
X! | (if possible)
X! [*]^Y | expose <*> more lines at top, cursor stays put
X! | (if possible)
X [*]^D | scroll <*> lines downward
X | (default the number of the previous scroll;
X | initialization: half a page)
X***************
X*** 297,303 ****
X / switch and shell commands /
X /////////////////////////////
X
X! Q | <del><del> | switch from vi to "ex"
X : | an "ex" command can be given
X :vi | switch from "ex" to vi
X :sh | execute a subshell, back to vi by ^D
X--- 321,327 ----
X / switch and shell commands /
X /////////////////////////////
X
X! Q | ^\ | <intr><intr> | switch from vi to "ex"
X : | an "ex" command can be given
X :vi | switch from "ex" to vi
X :sh | execute a subshell, back to vi by ^D
X***************
X*** 345,355 ****
X vi +x file : the cursor will immediately jump to line x
X vi +/<string> file : ~ to the first occurrence of <string>
X
X Sometimes (e.g. if the system crashed while you were editing) it is possible
X to recover files lost in the editor by "vi -r file".
X! If you just want to view a file by using vi, and you want to avoid any change,
X! instead of vi you can use the "view" command: the option 'readonly' will be set
X! automatically (with ":w!" you can override this option).
X The most important options are:
X
X ai | autoindent - in append mode after a <cr> the cursor
X--- 369,385 ----
X vi +x file : the cursor will immediately jump to line x
X vi +/<string> file : ~ to the first occurrence of <string>
X
X+ You can start at a particular tag with:
X+
X+ vi -t <tag> : starts in the right file in the right place
X+
X Sometimes (e.g. if the system crashed while you were editing) it is possible
X to recover files lost in the editor by "vi -r file".
X! If you just want to view a file by using vi, and you want to avoid any
X! change, instead of vi you can use the "view" or "vi -R" command: the option
X! 'readonly' will be set automatically (with ":w!" you can override this
X! option).
X!
X The most important options are:
X
X ai | autoindent - in append mode after a <cr> the cursor
X***************
X*** 394,399 ****
X--- 424,433 ----
X | furthermore completely empty lines and section
X | boundaries are paragraph boundaries too.
X redraw | the screen remains up to date
X+ remap | if on (default), macros are repeatedly expanded until
X+ | they are unchanged. Example: if 'o' is mapped to
X+ | 'O', and 'O' is mapped to 'I', then 'o' will map to
X+ | 'I' if "remap" is set, else it will map to 'O'.
X report=<*> | vi reports whenever e.g. a delete
X | or yank command affects <*> or more lines
X ro | readonly - the file is not to be changed
X***************
X*** 414,421 ****
X warn | warn you when you try to quit without writing
X wi=<*> | window - the number of lines vi is to show default
X wm=<*> | wrapmargin - when in append mode vi automatically
X! | puts a <lf> whenever there is a breakpoint (e.g. <sp>
X! | or ',') within <wm> columns from the right margin
X ws | wrapscan - when searching, the end is considered
X | 'stuck' to the begin of the file
X
X--- 448,455 ----
X warn | warn you when you try to quit without writing
X wi=<*> | window - the number of lines vi is to show default
X wm=<*> | wrapmargin - when in append mode vi automatically
X! | puts a <lf> whenever there is a <sp> or <ht> within
X! | <wm> columns from the right margin
X ws | wrapscan - when searching, the end is considered
X | 'stuck' to the begin of the file
X
X***************
X*** 426,428 ****
X--- 460,471 ----
X :set option? | show an option's value
X :set all | show all options and their values
X
X+ /////////////////
X+ / contributions /
X+ /////////////////
X+
X+ Maarten Litmaath <maart at cs.vu.nl>
X+ Rich Salz <rsalz at bbn.com>
X+ Eamonn McManus <emcmanus at cs.tcd.ie>
X+
X+ Patchlevel: 3
+ END-OF-FILE vi.ref.diff
chmod 'u=rw,g=r,o=r' 'vi.ref.diff'
set `wc -c 'vi.ref.diff'`
count=$1
case $count in
9325) :;;
*) echo 'Bad character count in ''vi.ref.diff' >&2
echo 'Count should be 9325' >&2
esac
exit 0
--
"rot H - dD/dt = J, div D = rho, div B = 0, |Maarten Litmaath @ VU Amsterdam:
rot E + dB/dt = 0" and there was light. |maart at cs.vu.nl, mcvax!botter!maart
More information about the Comp.unix.questions
mailing list