Vi Reference - patch 5

Maarten Litmaath maart at cs.vu.nl
Fri Sep 22 10:20:26 AEST 1989


Will it ever stop?
I hope the various mailers didn't choke over the ^L's.

: 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 'diffs.5'
sed 's/^X//' > 'diffs.5' << '+ END-OF-FILE ''diffs.5'
X*** vi.ref	Tue Sep  5 04:25:04 1989
X--- vi.ref.5	Fri Sep 22 02:09:54 1989
X***************
X*** 100,103 ****
X--- 100,104 ----
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,y]v/<string>/<cmd>  | execute <cmd> on the lines that don't match
X  
X      ///////////////////
X***************
X*** 191,194 ****
X--- 192,204 ----
X       - | &                  | repeat latest "ex" substitute command, e.g.
X                              | ":s/wrong/good"
X+      - | :[x,y]s/<p>/<r>/<f>| substitute (on lines x through y) the pattern
X+                             | <p> (default the last pattern) with the
X+                             | replacement string <r>
X+                             | useful flags <f> are `g' for `global' (i.e.
X+                             | change every non-overlapping occurrence of <p>)
X+                             | and `c' for `confirm' (type `y' to confirm a
X+                             | particular substitution, else <cr>)
X+                             | instead of `/' any punctuation CHAR unequal to
X+                             | <lf> can be used as delimiter
X  
X  
X***************
X*** 260,265 ****
X--- 270,279 ----
X      /////////////////////////////////////////////////
X  
X+     In `:' "ex" commands `%' denotes the current file, `#' is a synonym for
X+     the alternate file (which is normally the previous file).
X+ 
X      :q                      | quit vi, unless the buffer has been changed
X      :q!                     | quit vi without writing
X+     ^Z                      | suspend vi
X      :w                      | write the file
X      :w <name>               | write to the file <name>
X***************
X*** 279,293 ****
X      :x                      | idem
X      :x!                     | ":w!" and ":q"
X!     :e <file>               | edit another file without quitting vi - the
X                              | buffers are not changed (except the undo
X                              | buffer), so text can be copied from one
X                              | file to another this way
X!     :e! <file>              | idem, without writing the current buffer
X!     :e#                     | edit the previous file
X!     ^^                      | idem
X!     :rew                    | edit the first file (when "vi file1 file2 ...")
X      :rew!                   | idem, without writing the current buffer
X!     :n [<file>]             | edit the next file
X!     :n! [<file>]            | idem, without writing the current buffer
X  
X  
X--- 293,320 ----
X      :x                      | idem
X      :x!                     | ":w!" and ":q"
X!     :pre                    | preserve the file - the buffer is saved as if
X!                             | the system had just crashed; for emergencies,
X!                             | when a ":w" command has failed and you don't
X!                             | know how to save your work (see "vi -r")
X!     :f <name>               | set the current filename to <name>
X!     :cd [<dir>]             | set the working directory to <dir>
X!                             | (default home directory)
X!     :cd! [<dir>]            | idem, but don't save changes
X!     :e [+<cmd>] <file>      | edit another file without quitting vi - the
X                              | buffers are not changed (except the undo
X                              | buffer), so text can be copied from one
X                              | file to another this way
X!                             | [execute the "ex" command <cmd> (default "$")
X!                             | when the new file has been read into the buffer]
X!                             | <cmd> must contain no <sp> or <ht>
X!                             | (see "vi startup")
X!     :e! [+<cmd>] <file>     | idem, without writing the current buffer
X!     ^^                      | edit the alternate (normally the previous) file
X!     :rew                    | rewind the argument list, edit the first file
X      :rew!                   | idem, without writing the current buffer
X!     :n [+<cmd>] [<files>]   | edit the next file/specify a new argument list
X!     :n! [+<cmd>] [<files>]  | idem, without writing the current buffer
X!     :args                   | give the argument list, with the current file
X!                             | between `[' and `]'
X  
X  
X***************
X*** 396,400 ****
X      :sh                     | execute a subshell, back to vi by ^D
X      :!<cmd>                 | execute a shell <cmd>
X!     :!!                     | repeat the last shell command
X      [*]!<move><cmd>         | the shell executes <cmd>, with as standard
X                              | input the lines described by <*><move>,
X--- 423,428 ----
X      :sh                     | execute a subshell, back to vi by ^D
X      :!<cmd>                 | execute a shell <cmd>
X!     :!! [<args>]            | repeat the last shell command (and append <args>)
X!     :!<cmd> ! [<args>]      | use the previous command ('!') in a new command
X      [*]!<move><cmd>         | the shell executes <cmd>, with as standard
X                              | input the lines described by <*><move>,
X***************
X*** 434,441 ****
X  
X      However, the list of initializations can also be put into a file.
X!     If this file is located in your home directory, and is named
X!     ".exrc" AND the variable EXINIT is NOT set, the list will be
X!     executed automatically at startup time. If the 3 conditions are not
X!     met, you have to give the execute command yourself:
X  
X              :source file
X--- 462,470 ----
X  
X      However, the list of initializations can also be put into a file.
X!     If this file is located in your home directory, and is named ".exrc"
X!     AND the variable EXINIT is NOT set, the list will be executed
X!     automatically at startup time. However, vi will always execute the
X!     contents of a ".exrc" in the current directory, if you own the file.
X!     Else you have to give the execute command yourself:
X  
X              :source file
X***************
X*** 570,573 ****
X      Diomidis Spinellis <diomidis%ecrcvax.uucp at pyramid.pyramid.com>
X      Blair P. Houghton <bph at buengc.bu.edu>
X  
X!     Patchlevel: 4
X--- 599,605 ----
X      Diomidis Spinellis <diomidis%ecrcvax.uucp at pyramid.pyramid.com>
X      Blair P. Houghton <bph at buengc.bu.edu>
X+     Rusty Haddock <{uunet,att,rutgers}!mimsy.umd.edu!fe2o3!rusty>
X+     Panos Tsirigotis <panos at boulder.colorado.edu>
X+     David J. MacKenzie <djm at wam.umd.edu>
X  
X!     Patchlevel: 5
+ END-OF-FILE diffs.5
chmod 'u=rw,g=r,o=r' 'diffs.5'
set `wc -c 'diffs.5'`
count=$1
case $count in
6573)	:;;
*)	echo 'Bad character count in ''diffs.5' >&2
		echo 'Count should be 6573' >&2
esac
exit 0
-- 
   creat(2) shouldn't have been create(2): |Maarten Litmaath @ VU Amsterdam:
      it shouldn't have existed at all.    |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list