home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume4 / vms-vi-2 / part06 < prev    next >
Encoding:
Text File  |  1989-02-03  |  33.6 KB  |  1,022 lines

  1. Path: xanth!mcnc!gatech!bloom-beacon!bu-cs!mirror!necntc!ncoast!allbery
  2. From: gregg@a.cs.okstate.edu (Gregg Wonderly)
  3. Newsgroups: comp.sources.misc
  4. Subject: v04i097: TPUVI for VMS part 6 of 17
  5. Message-ID: <8809212058.AA07865@uunet.UU.NET>
  6. Date: 26 Sep 88 01:51:15 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: gregg@a.cs.okstate.edu (Gregg Wonderly)
  9. Lines: 1010
  10. Approved: allbery@ncoast.UUCP
  11.  
  12. Posting-number: Volume 4, Issue 97
  13. Submitted-by: "Gregg Wonderly" <gregg@a.cs.okstate.edu>
  14. Archive-name: vms-vi-2/Part06
  15.  
  16. $ show default
  17. $ if f$search("DOC.DIR;1") .eqs. "" then -
  18.      CREATE/LOG/DIRECTORY [.DOC]
  19. $ write sys$output "Creating [.DOC]VI_1.RNO"
  20. $ create [.DOC]VI_1.RNO
  21. $ DECK/DOLLARS="*$*$*EOD*$*$*"
  22. .ifnot system
  23. .! VI.RNO - Installation and help for VI emulation in TPU
  24. .! Written by Gregg Wonderly 22-JUL-1987
  25. .!
  26. .! RUNOFF operation instructions:
  27. .!
  28. .!     $ @VIDOC.COM
  29. .!
  30. .!   to create a document for printing.
  31. .!   
  32. .! We set the layout so that running page numbers are on the bottom
  33. .!
  34. .lo 1,2
  35. .st
  36. .!
  37. .! Initial right margin - sections should never set it higher than this.
  38. .! Set page size too.
  39. .ps 57,70 .rm 65
  40. .!
  41. .! Header level setup
  42. .sthl 6,0,0,8,9,1,1,9,2
  43. .dhl D,D,lu,d,ll,ll
  44. .!
  45. .!
  46. .flags bold
  47. .flags overstrike
  48. .!
  49. .c;                                             
  50. .sk 2
  51. .c;Guide for VI written in TPU
  52. .title Guide for VI written in TPU
  53. .sk 2
  54. .c;Gregg Wonderly
  55. .c;Mathematics Department
  56. .c;Oklahoma State University
  57. .sk 1
  58. .c;22-Jul-1987
  59. .else system
  60. .NO FLAGS ALL
  61. .P0
  62. .ap
  63. .NO NUMBER
  64. .NPA
  65. .LM1.RM70
  66. .I-1
  67. 1 VI
  68. .s
  69. VI is a text editor written in TPU, for more background information,
  70. see "HELP VI Introduction".
  71. .s
  72. .endif system
  73. .!
  74. .ifnot system
  75. .pg
  76. .hl 1 ^*Table of contents\*
  77. .req "vi.rnt"
  78. .pg
  79. .send toc .ifnot global
  80. .hl 1 ^*Purpose of this document\*
  81. .send toc .endif global
  82. This document provides an overview of this particular emulation
  83. of the VI editor.  It does not provide information on learning to
  84. use the VI editor.  It is assumed that the reader knows how to use VI to a
  85. reasonable extent, and/or has access to a VI manual or quick reference guide.
  86. .send toc .ifnot global
  87. .hl 1 ^*Introduction to VI\*
  88. .send toc .endif global
  89. .!
  90. .else system     
  91. .!               
  92. .i-1
  93. 2 Introduction
  94. .s
  95. .endif system
  96. .!
  97. VI is an editor which was originally written by Bill Joy at the University
  98. of Berkeley in California.  It was written to work on the UNIX (UNIX is a
  99. trademark of the American Telephone and Telegraph Corporation) operating
  100. system, and until now, has not been widely available on other operating
  101. systems.  VI is an excellent editor, but its full potential can not be realized 
  102. without a full understanding of the commands that are available.  Currently,
  103. this help file does not describe all of the keystrokes that are defined.
  104. You should consult one of the many VI quick reference guides for that
  105. information.  This version of VI should be close enough to the real version
  106. that the documentation of the additional features here, and a VI quick
  107. reference guide should suffice.
  108. .s
  109. VI is a mode oriented editor, and has two modes.  One mode allows text entry by
  110. simply typing (called text entry mode), and the other allows text manipulation
  111. by using the typing keys (called command mode).  This is a completely
  112. different approach to editing than used by most other text editors and word
  113. processors.  However, it provides some incredible possibilities for speed
  114. because one does not have to look to find function keys to perform certain
  115. editing tasks.  Also, many more commands can be placed within reach of your
  116. hands because all of the keys on the keyboard are available for use during
  117. command mode operations. 
  118. .s
  119. .!
  120. .if system
  121. .i-1
  122. 2 Author
  123. .s
  124. This emulation of VI was written by
  125. .s
  126. .lm+5
  127. Gregg Wonderly
  128. .br           
  129. Mathematics Department
  130. .br
  131. Oklahoma State University
  132. .s
  133. Internet: gregg@nemo.math.okstate.edu
  134. .lm-5
  135. .s
  136. .endif system
  137. .!
  138. .ifnot system
  139. .send toc .ifnot global
  140. .hl 1 ^*Extensions to VI\*
  141. .send toc .endif global
  142. .else system
  143. .i-1             
  144. 2 Extensions
  145. .s
  146. .endif system
  147. This emulation of VI contains some extensions that were made possible by
  148. the existance of supporting primitives in TPU.  A partial list of these
  149. extensions follows.
  150. .s
  151. .lm+5
  152. Select regions are available and can be used to perform many operations such
  153. as deleting, yanking, changing, shifting, changing/inverting case, compiling
  154. TPU procedures, filling regions of text to fit within a specified range of
  155. columns and writing portions of buffers to files/devices.
  156. .s
  157. Multiple buffers are available as well as multiple windows to display
  158. the buffers in.  This allows you to edit/view many files at once.
  159. .s
  160. You can force the editor to expand tabs as you type them, so that they are
  161. replaced by spaces in the text.
  162. .s
  163. You can control the use of TPU's typeahead recognition so that you see
  164. each screen update action while you type (with ":set [no]update").
  165. .s
  166. The EX mode commands, 'show buffers' and 'show files', display information about
  167. existing buffers, and the current list of files to edit, respectively.
  168. .s
  169. The EX mode command, sh, has an alias called 'dcl', which is a little more
  170. indicative of the action taken.
  171. .s
  172. The EX mode command, buffer, allows you to create a new buffer that may not
  173. have a file associated with it.  It also allows you to create a buffer by
  174. a specific name, and associate an arbitrary file with that buffer.
  175. .s
  176. The EX mode command, messages, allows you to map the TPU message buffer into the
  177. current window for viewing.
  178. .s
  179. The EX mode command, delbuf, allows you to delete a buffer according to its
  180. name.
  181. .s
  182. The EX mode command, prev, allows you to move back to the previously edited
  183. buffer that you used the 'next' command to leave.
  184. .s
  185. The EX mode command, tpu, allows you to execute arbitrary TPU statements from
  186. the editor.
  187. .lm-5
  188. .ifnot system
  189. .send toc .ifnot global
  190. .hl 1 ^*Using an initialization file\*
  191. .send toc .endif global
  192. .else system
  193. .I-1             
  194. 2 Initialization
  195. .s
  196. .endif system
  197. VI allows you to use a file to initialize the options and settings that you wish
  198. to use, automatically, each time the editor is envoked.  Note that when you use
  199. VI in a subprocess, the initialization is done only when the subprocess is first
  200. created, and not on any subsequent attach operations. The file SYS$LOGIN:VI.INI
  201. can contain EX mode commands, one per line, that will be executed after the
  202. file(s) selected are loaded into buffers.  Alternatively, the file may be
  203. located anywhere by defining the logical name, EXRC, to be the name of the file
  204. you wish to use for initialization (this name is similar, minus a leading
  205. '.', to that used under UNIX).  Also, if you have only a single line of
  206. initialization, then the process logical, EXINIT (again a holdover from
  207. UNIX), can be defined to be the line
  208. of initialization, and it will be translated, and the resulting text executed. 
  209. This is generally faster than processing the EXRC file.
  210. .!
  211. .ifnot system
  212. .send toc .ifnot global
  213. .hl 1 ^*Supported EX mode commands\*
  214. .send toc .endif global
  215. .else system
  216. .I-1             
  217. 2 Ex_mode
  218. .s
  219. .endif system
  220. .!
  221. EX mode is entered by typing a ":" (or the DO key).  From the ":" prompt, you
  222. can perform many different functions associated with changing the operation
  223. of the editor.  EX mode also allows you to perform operations such as global
  224. search and replace, block deletion of text, and many other operations that
  225. are not easily described with a single keystroke.  Below is a list of the
  226. commands that can be performed from EX mode.  The term, l_spec, is a
  227. specification for a line of the current file, and takes the form of either a
  228. search pattern, as in:
  229. .lm +5
  230. .s
  231. /foo/  or  ?foo?
  232. .s                                                                    
  233. .lm -5
  234. an explict line number as in "5", or perhaps a relative line number as in ".+5"
  235. which means the current line, plus five lines.  There are two other special
  236. characters, like ".", they are "$" which means the last line of the file, and
  237. "%" which means every line in the file.  Any place that two l_specs are required
  238. to delimit a range of lines, a single "%" can be used to specify the entire
  239. file.  Markers can also be used as l_specs.  A single ' character should precede
  240. the letter corresponding to the mark.  e.g. 'a,'b is the range of lines from
  241. mark 'a' to mark 'b'.  Certain commands such as "w" act on the entire buffer by
  242. default, and do not require a range.  If you specify a range of lines by
  243. separating two l_specs with a ",", the first specification must indicate a line
  244. that preceeds the second specification.  If not, the message, "Bad range of
  245. lines!" will be displayed, and the command will be aborted. 
  246. .if system
  247. .I-1
  248. 3 Abort_edit
  249. .else system
  250. .send toc .if global
  251. .hl 2 ^*Abort edit\*
  252. .send toc .endif global
  253. .endif system
  254. .s               
  255. .LT
  256. :q{uit}[!]                  This command quits the editor.  If
  257.                             "!" is not specified, and there are
  258.                             modified buffers, then you will be
  259.                             told so, and the command will be
  260.                             aborted.  You must then either retype
  261.                             the command with a "!" (if you really
  262.                             want to ignore the modified buffers,
  263.                             and lose those changes), or you must
  264.                             write out the modified buffers. 
  265. .EL
  266. .if system
  267. .I-1
  268. 3 Change_output_file
  269. .else system
  270. .send toc .ifnot global
  271. .hl 2 ^*Change output file\*
  272. .send toc .endif global
  273. .endif system
  274. .s               
  275. .LT
  276. :file <file spec>           Changes the output file specification
  277.                             of the current buffer to the
  278.                             specified file. This will result in
  279.                             the buffer being written to the new
  280.                             file whenever a ":w", ":xit" or "ZZ"
  281.                             command is issued.  Note that an
  282.                             unmodified buffer will still be un-
  283.                             modified after this has been done, so
  284.                             you must write it out explicitly, or
  285.                             modify it inorder to assure the a
  286.                             file by the indicated name is created
  287. .EL
  288. .if system
  289. .I-1
  290. 3 Compile_TPU
  291. .else system
  292. .send toc .ifnot global
  293. .hl 2 ^*Compile TPU\*
  294. .send toc .endif global
  295. .endif system
  296. .s               
  297. .LT
  298. :[l_spec][,l_spec]tpu       Compiles the indicated region,
  299.                             making the assumption, that the
  300.                             region contains TPU language code. 
  301.                             An active select region can be used
  302.                             in place of the l_specs.
  303. .EL
  304. .if system       
  305. .I-1
  306. 3 Copy_lines
  307. .else system
  308. .send toc .ifnot global
  309. .hl 2 ^*Copy lines\*
  310. .send toc .endif global
  311. .endif system
  312. .s               
  313. .LT
  314. :l_spec_1,l_spec_2 c{opy} l_spec_3
  315.                             The range of lines indicated by
  316.                             l_spec_1 and l_spec_2 are copied in
  317.                             their entirety, to the location after
  318.                             the line indicated by l_spec_3. 
  319. .EL
  320. .if system       
  321. .I-1
  322. 3 Create_buffers
  323. .else system
  324. .send toc .ifnot global
  325. .hl 2 ^*Create buffers\*
  326. .send toc .endif global
  327. .endif system
  328. .s               
  329. .LT
  330. :b{uffer} [<buffer name>] [<file spec>]
  331.                             This command maps the buffer named to
  332.                             the current window.  If there is no
  333.                             buffer by the name given, then a new
  334.                             buffer will be created.  If <file
  335.                             spec> is given, the named file will
  336.                             be read into any newly created
  337.                             buffer. 
  338. .EL
  339. .if system
  340. .I-1
  341. 3 Create_key_macro
  342. .else system
  343. .send toc .ifnot global
  344. .hl 2 ^*Create key macro\*
  345. .send toc .endif global
  346. .endif system
  347. .s               
  348. .LT
  349. :map[!] <key> <key strokes> Allows you to establish a mapping
  350.                             or macro for a single keystroke.  If
  351.                             a "!" is specified then the
  352.                             mapping/macro is in effect during
  353.                             text entry mode, otherwise the
  354.                             mapping/macro is in effect during
  355.                             command mode. The next time that
  356.                             <key> is typed in the affected mode,
  357.                             the string of keystokes specified
  358.                             will be substituted for the single
  359.                             key typed.  ":map" without any
  360.                             parameters displays the current
  361.                             mappings.
  362. .EL
  363. .if system
  364. .I-1
  365. 3 Delete_buffers
  366. .else system
  367. .send toc .ifnot global
  368. .hl 2 ^*Delete buffers\*
  369. .send toc .endif global
  370. .endif system
  371. .s               
  372. .LT
  373. :de{lbuf}[!] <buffer name>  This command allows you to delete a
  374.                             buffer by name so that it is no
  375.                             longer in existance.  This will
  376.                             destroy the contents of the buffer.
  377.                             If the buffer is modified you can
  378.                             specify the "!" to assure that the
  379.                             buffer is deleted. Otherwise when the
  380.                             buffer is modified you will be
  381.                             prompted to make sure that you wish
  382.                             to delete that buffer.  An unmodifed
  383.                             buffer will be deleted without any
  384.                             prompting, whether or not a "!" is
  385.                             specified.  Note that the current
  386.                             buffer can never be deleted unless
  387.                             there is more than one window on the
  388.                             screen.  When this is the case, then
  389.                             the window(s) occupied by the buffer
  390.                             you wish to delete will be deleted
  391.                             from the screen.  When a window
  392.                             containing the object buffer is
  393.                             occluded (hidden) during MAKE FULL
  394.                             SCREEN, then you will not be able to
  395.                             delete that buffer.
  396. .EL
  397. .if system
  398. .I-1
  399. 3 Delete_lines
  400. .else system
  401. .send toc .ifnot global
  402. .hl 2 ^*Delete lines\*
  403. .send toc .endif global
  404. .endif system
  405. .s               
  406. .LT
  407. :[l_spec][,l_spec]d         Delete the line(s) specified.  If a
  408.                             range of lines is not specified, the
  409.                             current line is deleted.
  410. .EL
  411. .if system
  412. .I-1
  413. 3 Edit_new_file  
  414. .else system
  415. .send toc .ifnot global
  416. .hl 2 ^*Edit new file\*
  417. .send toc .endif global
  418. .endif system
  419. .s               
  420. .LT
  421. :e{dit} <file spec>         This command allows you to switch to
  422.                             a different file that you want to
  423.                             edit.  File spec is first compared to
  424.                             the name of an existing buffer.  If
  425.                             there is a buffer by that name, then
  426.                             it is mapped to the current window.
  427.                             If not, then the indicated file will
  428.                             be read into a new buffer, which will
  429.                             be mapped to the current window. 
  430. .EL
  431. .if system
  432. .s
  433. .LT
  434. :vi <file spec>             This command is an alias for the
  435.                             e[dit] command.  For more information
  436.                             see the description of that command. 
  437. .EL
  438. .endif system
  439. .!
  440. .if system
  441. .I-1
  442. 3 Execute_command_file
  443. .else system
  444. .send toc .ifnot global
  445. .hl 2 ^*Execute command file\*
  446. .send toc .endif global
  447. .endif system
  448. .s               
  449. .LT
  450. :so <file spec>             The specified file will be read,
  451.                             line by line, and each line will be
  452.                             interpreted as an EX mode command. 
  453. .EL
  454. .if system
  455. .I-1
  456. 3 Fill_text_region
  457. .else system
  458. .send toc .ifnot global
  459. .hl 2 ^*Fill text region\*
  460. .send toc .endif global
  461. .endif system
  462. .s               
  463. .LT
  464. :[l_spec][,l_spec]fill <left margin> <right margin>
  465.                             The indicated lines will be filled,
  466.                             wrapped, and joined so that they are
  467.                             as full as possible. The left and
  468.                             right margin values will determine
  469.                             how long the lines are, and where
  470.                             they start and stop.  A select region
  471.                             may be used in place of the l_specs.
  472. .EL
  473. .if system                       
  474. .I-1
  475. 3 Global_Substitution
  476. .else system
  477. .send toc .ifnot global
  478. .hl 2 ^*Global Substitution\*
  479. .send toc .endif global
  480. .endif system    
  481. .s      
  482. .LT
  483. :[gv]/search_re/cmd
  484.                             whether or not the substitution is to
  485.                             If g is specified then cmd is
  486.                             performed on all lines containing
  487.                             search_re.  If v is specified then
  488.                             cmd is performed on all lines NOT
  489.                             containing search_re.  cmd is either
  490.                             'd' to delete the selected lines,
  491.                             s/from_re/to_re/[g][c] to perform a
  492.                             substitution within the selected
  493.                             lines (see the substitute command
  494.                             elsewhere for a description of its
  495.                             operation), or 'p' to print the lines
  496.                             matched by the search_re and the
  497.                             particular mode, 'g' or 'v'.  The
  498.                             lines selected will be placed into a
  499.                             buffer that is mapped onto the
  500.                             current window.  You will be asked to 
  501.                             hit return when the command has
  502.                             completed.
  503. .EL
  504. .if system
  505. .I-1
  506. 3 Goto_Line
  507. .else system 
  508. .send toc .ifnot global
  509. .hl 2 ^*Goto Line\*
  510. .send toc .endif global
  511. .endif system
  512. .s               
  513. .LT
  514. :l_spec[,l_spec]            Goto the beginning of the line(s)
  515.                             specified.
  516. .EL
  517. .if system
  518. .I-1
  519. 3 Goto_tag_in_file
  520. .else system     
  521. .send toc .ifnot global
  522. .hl 2 ^*Goto tag in file\*
  523. .send toc .endif global
  524. .endif system
  525. .s               
  526. .LT
  527. :ta [tag]                   The tag specified, or if none, then
  528.                             the tag following the cursor is
  529.                             located in one of the files specified
  530.                             by the "tags" value.  The associated
  531.                             file is loaded, or switched to, and
  532.                             the corresponding command executed.
  533.                             If the tag can not be located, then a
  534.                             diagnostic is issued. 
  535. .EL
  536. .if system
  537. .I-1
  538. 3 Help
  539. .else system
  540. .send toc .ifnot global
  541. .hl 2 ^*Help\*
  542. .send toc .endif global
  543. .endif system
  544. .s               
  545. .LT
  546. :help <VI help topic>       Gives you access to this document as
  547.                             well as other VMS help topics from
  548.                             within VI. 
  549. .EL
  550. .if system
  551. .I-1
  552. 3 Invert_case    
  553. .else system
  554. .send toc .ifnot global
  555. .hl 2 ^*Invert case\*
  556. .send toc .endif global
  557. .endif system
  558. .s               
  559. .LT
  560. :[l_spec][,l_spec]in{vert}  The case of all alphabetic
  561.                             characters in the indicated region
  562.                             will be inverted.  A select range
  563.                             may be used in place of the l_specs
  564. .EL
  565. .if system
  566. .I-1             
  567. 3 Learn_Key_Strokes
  568. .else system
  569. .send toc .ifnot global
  570. .hl 2 ^*Learn Key Strokes\*
  571. .send toc .endif global
  572. .endif system
  573. .s               
  574. .LT
  575. :learn                      Initiates remembering of keystrokes.
  576.                             This allows a particular sequence of
  577.                             key strokes to be repeated at a later
  578.                             time by typing a single key. This
  579.                             facility is similar to that provided
  580.                             by the :map command. The difference
  581.                             being, that you must "know" the keys
  582.                             you want to type for the :map
  583.                             command.  A learn sequence is
  584.                             remembered as you type the keys and
  585.                             the associated actions are carried
  586.                             out. When you are done typing a learn
  587.                             sequence, then you should use CTRL-R
  588.                             to bind that sequence to the desired
  589.                             key.  Note that :set undomap also
  590.                             pertains to how learned sequence
  591.                             behave when undo is performed. 
  592. .EL
  593. .if system
  594. .I-1
  595. 3 Lower_case
  596. .else system
  597. .send toc .ifnot global
  598. .hl 2 ^*Lower case\*
  599. .send toc .endif global
  600. .endif system
  601. .s               
  602. .LT
  603. :[l_spec][,l_spec]lo{wer}   The case of all alphabetic
  604.                             characters in the indicated region
  605.                             will be changed to lower case.  A
  606.                             select region may be used instead
  607.                             of l_specs.
  608. .EL
  609. .if system       
  610. .I-1
  611. 3 Message_buffer
  612. .else system
  613. .send toc .ifnot global
  614. .hl 2 ^*Message buffer\*
  615. .send toc .endif global
  616. .endif system
  617. .s               
  618. .LT
  619. :me{ssages}                 This command simply maps the TPU
  620.                             messages buffer to the current window
  621.                             so that its contents may be viewed. 
  622.                             You may use the ^~ (Ctrl-tilde) key-
  623.                             stroke to switch back to the previous
  624.                             buffer.
  625. .EL              
  626. .if system
  627. .I-1
  628. 3 Move_lines
  629. .else system
  630. .send toc .ifnot global
  631. .hl 2 ^*Move lines\*
  632. .send toc .endif global
  633. .endif system
  634. .s               
  635. .LT
  636. :l_spec_1,l_spec_2 m{ove} l_spec_3
  637.                             The range of lines indicated by
  638.                             l_spec_1 and l_spec_2 are moved in
  639.                             their entirety, to the location after
  640.                             the line indicated by l_spec_3. 
  641. .EL
  642. .if system       
  643. .I-1
  644. 3 Next_file
  645. .else system
  646. .send toc .ifnot global
  647. .hl 2 ^*Next file\*
  648. .send toc .endif global
  649. .endif system
  650. .s               
  651. .LT
  652. :n{ext}                     Moves the pointer in the list of
  653.                             files currently being edited to the
  654.                             next file.  The buffer associated
  655.                             with that file will be mapped to the
  656.                             current window. 
  657. .EL
  658. .if system       
  659. .I-1
  660. 3 Perform_Macros
  661. .else system
  662. .send toc .ifnot global
  663. .hl 2 ^*Perform Macros\*
  664. .send toc .endif global
  665. .endif system
  666. .s               
  667. .LT
  668. :@<a-z>                     Executes the first line of the
  669.                             indicated named buffers as command
  670.                             mode commands. 
  671. .EL
  672. .if system
  673. .I-1
  674. 3 Previous_file  
  675. .else system
  676. .send toc .ifnot global
  677. .hl 2 ^*Previous file\*
  678. .send toc .endif global
  679. .endif system
  680. .s               
  681. .LT
  682. :pr{ev}                     Moves the pointer in the list of
  683.                             files currently being edited, to the
  684.                             previous file.  The buffer associated
  685.                             with that file will be mapped to the
  686.                             current window. 
  687. .EL
  688. .if system       
  689. .I-1
  690. 3 Print_out_lines
  691. .else system
  692. .send toc .ifnot global
  693. .hl 2 ^*Print out lines\*
  694. .send toc .endif global
  695. .endif system
  696. .s               
  697. .LT
  698. :[l_spec,l_spec]p             Scrolls the current buffer through
  699.                             the range of lines indicated, in the
  700.                             current window.
  701. .EL
  702. .if system
  703. .I-1
  704. 3 Read_file_into_buffer
  705. .else system
  706. .send toc .ifnot global
  707. .hl 2 ^*Read file into buffer\*
  708. .send toc .endif global
  709. .endif system
  710. .s               
  711. .LT
  712. :[l_spec]r{ead} <file spec> Reads the contents of the specified
  713.                             file, and inserts it into the current
  714.                             buffer after the indicated line.  If
  715.                             no line is specified, then the
  716.                             current line is used. 
  717. .EL
  718. .if system       
  719. .I-1
  720. 3 Rewind_file_list
  721. .else system
  722. .send toc .ifnot global
  723. .hl 2 ^*Rewind file list\*
  724. .send toc .endif global
  725. .endif system
  726. .s               
  727. .LT
  728. :rew                        Will reset the pointer in the list
  729.                             of files being edit to the first one.
  730.                             The buffer associated with that file
  731.                             will be mapped to the current window. 
  732. .EL
  733. .if system
  734. .I-1             
  735. 3 Select_regions
  736. .else system
  737. .send toc .ifnot global
  738. .hl 2 ^*Select regions\*
  739. .send toc .endif global
  740. .endif system
  741. .s               
  742. .LT
  743. :select                     Toggles the status of the select 
  744.                             region that can be used in place of a
  745.                             range specified in some of the EX
  746.                             mode commands, as well as any of the,
  747.                             buffer altering, command mode editing
  748.                             commands. 
  749. .EL              
  750. .if system
  751. .I-1
  752. 3 Set_default_dir
  753. .else system
  754. .send toc .ifnot global
  755. .hl 2 ^*Set default dir\*
  756. .send toc .endif global
  757. .endif system
  758. .s               
  759. .LT
  760. :cd <default spec>          Changes the default directory that
  761.                             that the editor process is running
  762.                             in.  The new default directory is
  763.                             shown in the message window. 
  764. .EL .S .LT
  765. :chdir                      Same as the cd command.
  766. .EL              
  767. .if system
  768. .I-1
  769. 3 Set_options
  770. .else system
  771. .send toc .ifnot global
  772. .hl 2 ^*Set options\*
  773. .send toc .endif global
  774. .endif system
  775. .s               
  776. .LT
  777. :set [no]option[=value] [...]
  778.                             Sets one or more options that dictate
  779.                             the behavior of the editor.  These
  780.                             options are described in full later.
  781.                             If the option is boolean in nature as
  782.                             is "wrapscan", then you must either
  783.                             specify "wrapscan" or "nowrapscan".
  784.                             If the option is variable in nature,
  785.                             as is "scroll", then you should
  786.                             specify "option=value" as in
  787.                             "scroll=21".
  788. .EL
  789. .if system
  790. .I-1
  791. 3 Show_buffers
  792. .else system
  793. .send toc .ifnot global
  794. .hl 2 ^*Show buffers\*
  795. .send toc .endif global
  796. .endif system
  797. .s               
  798. .LT
  799. :show buffers               Displays the list of currently active
  800.                             buffers that you have created for
  801.                             editing files. 
  802. .EL
  803. .if system
  804. .I-1
  805. 3 Show_current_version
  806. .else system
  807. .send toc .ifnot global
  808. .hl 2 ^*Showing Current Version\*
  809. .send toc .endif global
  810. .endif system
  811. .LT
  812. :version                    Places a message about the current
  813.                             version of VI into the status line.
  814. .EL
  815. .if system
  816. .I-1
  817. 3 Show_file_list 
  818. .else system
  819. .send toc .ifnot global
  820. .hl 2 ^*Show file list\*
  821. .send toc .endif global
  822. .endif system
  823. .s               
  824. .LT
  825. :show files                 Displays the list of one or more
  826.                             files that matched the file spec that
  827.                             you last gave as the parameter to a
  828.                             "vi" or "edit" command.  This list of
  829.                             files is used by the ":next", ":prev"
  830.                             and ":rew" EX commands to allow you
  831.                             to cycle through a list of files in a
  832.                             logical sequence.  You can change the
  833.                             line that the cursor is on to change
  834.                             which file :next and :prev display by
  835.                             using, ^D ^U, h, j, k, and l key
  836.                             strokes. 
  837. .EL
  838. .if system
  839. .I-1
  840. 3 Show_tags
  841. .else system
  842. .send toc .ifnot global
  843. .hl 2 ^*Show Tags\*
  844. .send toc .endif global
  845. .endif system
  846. .s               
  847. .LT
  848. :show tags                  Displays the contents of the buffer
  849.                             that is used to resolve "tag"
  850.                             references.  This can be used to make
  851.                             sure that you are specifying the
  852.                             proper tags. 
  853. .EL
  854. .if system       
  855. .I-1
  856. 3 Spawn_command
  857. .else system
  858. .send toc .ifnot global
  859. .hl 2 ^*Spawn command\*
  860. .send toc .endif global
  861. .endif system
  862. .s               
  863. .LT
  864. :!<DCL command>             Spawns a subprocess to run the given
  865.                             DCL command in.  You will be asked to
  866.                             "[Hit ENTER to continue]" before the
  867.                             screen is redrawn when the command
  868.                             finishes.
  869. .EL
  870. .if system       
  871. .I-1
  872. 3 Spawn_subprocess
  873. .else system
  874. .send toc .ifnot global
  875. .hl 2 ^*Spawn subprocess\*
  876. .send toc .endif global
  877. .endif system
  878. .s               
  879. .LT
  880. :sh (:dcl)                  Spawns a DCL subprocess that you can
  881.                             use to perform some DCL related task
  882.                             with, and then LOGOUT of. 
  883. .EL
  884. .if system                       
  885. .I-1
  886. 3 Substitution   
  887. .else system
  888. .send toc .ifnot global
  889. .hl 2 ^*Substitution\*
  890. .send toc .endif global
  891. .endif system
  892. .s               
  893. .LT
  894. :l_spec[,l_spec]s/from_re/to_re/[g][c]
  895.                             Perform the indicated substitution on
  896.                             the indicated line(s) of text. Note
  897.                             that '&' is a single character alias
  898.                             for the last substitution made (not
  899.                             including line specs or options). The
  900.                             [g] option causes every occurence on
  901.                             a line to be replaced. By default,
  902.                             only the first is replaced.  The [c]
  903.                             option will cause the editor to pause
  904.                             and highlight the text matching the
  905.                             from_re, before each substition. You
  906.                             are given the opportunity to say
  907.                             whether or not the substitution is to
  908.                             be performed. 
  909. .EL
  910. .if system
  911. .I-1
  912. 3 Text_Abbreviations
  913. .else system
  914. .send toc .ifnot global
  915. .hl 2 ^*Text Abbreviations\*
  916. .send toc .endif global
  917. .endif system
  918. .s               
  919. .LT
  920. :abbr <short> <long>        Creates an abbreviation for the text
  921.                             given by <long>.  <short> is a simple
  922.                             string of characters, e.g. ATT, and
  923.                             <long> is a more complicated string
  924.                             as in, American Telephone and Tele-
  925.                             graph.  ":abbr" by itself displays a
  926.                             list of the current abbreviations. 
  927.  
  928. :unabbr <short>             Removes a previously defined abbrev-
  929.                             iation that was defined with ":abbr".
  930. .EL
  931. .if system
  932. .I-1
  933. 3 Unmap_key_macros
  934. .else system
  935. .send toc .ifnot global
  936. .hl 2 ^*Unmap key macros\*
  937. .send toc .endif global
  938. .endif system
  939. .s               
  940. .LT
  941. :unmap[!]                   Removes a previously established map.
  942.                             The "!" must be present if you wish
  943.                             to unmap a map that was made
  944.                             specifying the "!". 
  945. .EL
  946. .if system
  947. .I-1             
  948. 3 Upper_case
  949. .else system
  950. .send toc .ifnot global
  951. .hl 2 ^*Upper case\*
  952. .send toc .endif global
  953. .endif system
  954. .s               
  955. .LT
  956. :[l_spec][,l_spec]upper     The case of all alphabetic characters
  957.                             in the indicated region will be
  958.                             changed to upper case.  A select
  959.                             region may be used in place of the
  960.                             l_specs. 
  961. .EL
  962. .!               
  963. .if system
  964. .I-1
  965. 3 Write_buffer
  966. .else system
  967. .send toc .ifnot global
  968. .hl 2 ^*Write buffer\*
  969. .send toc .endif global
  970. .endif system
  971. .s
  972. .LT
  973. :[l_spec][,l_spec]w{rite}[!] [<file spec>]
  974.                             The indicated line(s) will be written
  975.                             to a file.  The name of the file can
  976.                             either be specified, or will default
  977.                             to the current buffer.  There are
  978.                             certain operations that are not
  979.                             permitted unless the "!" is typed
  980.                             following "w{rite}".  If "!" is not
  981.                             present, you can NOT write all or
  982.                             portions of the buffer to a file that
  983.                             already exists, unless it is the file
  984.                             associated with the current buffer.
  985.                             Also, you can not write out a portion
  986.                             of the current buffer to it's
  987.                             associated file without specifying
  988.                             the "!". This protects you from
  989.                             unknowingly clobbering a file.  Note
  990.                             that the append operation is not
  991.                             possible.
  992.  
  993. :[l_spec][,l_spec]wq[!] [<file spec>]
  994.                             This command is identical to typing a
  995.                             ":w" command followed by typing a
  996.                             ":q" command.  See the descriptions
  997.                             of those commands for more details. 
  998. .EL
  999. .if system
  1000. .I-1
  1001. 3 Write_and_exit
  1002. .else system
  1003. .send toc .ifnot global
  1004. .hl 2 ^*Write and exit\*
  1005. .send toc .endif global
  1006. .endif system
  1007. .s
  1008. .LT
  1009. :x{it}                      Is synomous with typing "ZZ" while
  1010.                             in command mode.  The contents of the
  1011.                             current buffer will be written out if
  1012.                             they are modified.  All other buffers
  1013.                             will then be examined, and you will
  1014.                             be asked whether or not you wish to
  1015.                             write out any other modified buffer.
  1016.                             The ":set nowrite" command will force
  1017.                             a modifed buffer to be ignored during
  1018.                             this search. 
  1019. .EL
  1020. *$*$*EOD*$*$*
  1021. $ exit
  1022.