home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / Documents / Others / viCourse+ / ComFunRef.txt < prev    next >
Text File  |  1992-12-20  |  50KB  |  1,387 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.               Vi Command & Function Reference
  11.  
  12.  
  13.                       Alan P.W. Hewett
  14.  
  15.           Revised for version 2.12 by Mark Horton
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22. _1.  _A_u_t_h_o_r'_s _D_i_s_c_l_a_i_m_e_r
  23.  
  24. This document does not claim to be 100% complete.  There are
  25. a  few  commands  listed in the original document that I was
  26. unable to test either because I do not speak  lisp,  because
  27. they  required  programs  we don't have, or because I wasn't
  28. able to make them work.  In these cases I left  the  command
  29. out.   The  commands listed in this document have been tried
  30. and are known to work.   It  is  expected  that  prospective
  31. users  of  this document will read it once to get the flavor
  32. of everything that vi can do and then use it as a  reference
  33. document.   Experimentation  is  recommended.   If you don't
  34. understand a command, try it and see what happens.
  35.  
  36. [Note: In revising this document, I have attempted  to  make
  37. it  completely  reflect  version  2.12  of  _v_i.  It does not
  38. attempt to document the VAX version (version  3),  but  with
  39. one  or  two  exceptions (wrapmargin, arrow keys) everything
  40. said about 2.12 should apply to 3.1.  _M_a_r_k _H_o_r_t_o_n]
  41.  
  42. _2.  _N_o_t_a_t_i_o_n
  43.  
  44. [option] is used to denote  optional  parts  of  a  command.
  45. Many  vi  commands have an optional count.  [cnt] means that
  46. an optional number may precede the command  to  multiply  or
  47. iterate  the  command.   {variable  item}  is used to denote
  48. parts of the command which  must  appear,  but  can  take  a
  49. number  of different values.  <character [-character]> means
  50. that the character or one of the  characters  in  the  range
  51. described  between  the  two  angle brackets is to be typed.
  52. For example <esc> means the escape key is to be typed.   <a-
  53. z> means that a lower case letter is to be typed.  ^<charac-
  54. ter> means that the character is to be typed  as  a  control
  55. character,  that  is,  with  the  <cntl> key held down while
  56. simultaneously typing  the  specified  character.   In  this
  57. document  control characters will be denoted using the _u_p_p_e_r
  58. _c_a_s_e character, but ^<uppercase chr>  and  ^<lowercase  chr>
  59. are  equivalent.   That  is,  for  example, <^D> is equal to
  60. <^d>.  The most common character abbreviations used in  this
  61.  
  62.  
  63.  
  64.                        July 21, 1991
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                            - 2 -
  71.  
  72.  
  73. list are as follows:
  74.  
  75. <esc>   escape, octal 033
  76.  
  77. <cr>    carriage return, ^M, octal 015
  78.  
  79. <lf>    linefeed ^J, octal 012
  80.  
  81. <nl>    newline, ^J, octal 012 (same as linefeed)
  82.  
  83. <bs>    backspace, ^H, octal 010
  84.  
  85. <tab>   tab, ^I, octal 011
  86.  
  87. <bell>  bell, ^G, octal 07
  88.  
  89. <ff>    formfeed, ^L, octal 014
  90.  
  91. <sp>    space, octal 040
  92.  
  93. <del>   delete, octal 0177
  94.  
  95.  
  96. _3.  _B_a_s_i_c_s
  97.  
  98. To run vi the  shell  variable  TERM  must  be  defined  and
  99. exported  to  your  environment.  How you do this depends on
  100. which shell you are using.  You can  tell  which  shell  you
  101. have by the character it prompts you for commands with.  The
  102. Bourne shell prompts with `$', and the C shell prompts  with
  103. `%'.  For these examples, we will suppose that you are using
  104. an HP 2621 terminal, whose termcap name is ``2621''.
  105.  
  106. _3._1.  _B_o_u_r_n_e _S_h_e_l_l
  107.  
  108. To manually set your terminal type to 2621 you would type:
  109.  
  110.         TERM=2621
  111.         export TERM
  112.  
  113.  
  114.      There are various ways of having this automatically  or
  115. semi-automatically  done  when you log in.  Suppose you usu-
  116. ally dial in on a 2621.   You  want  to  tell  this  to  the
  117. machine,  but  still  have  it work when you use a hardwired
  118. terminal.  The recommended way, if you have  the  _t_s_e_t  pro-
  119. gram, is to use the sequence
  120.  
  121.         tset -s -d 2621 > tset$$
  122.         . tset$$
  123.         rm tset$$
  124.  
  125. in your .login (for csh) or the same thing using `.' instead
  126. of  `source' in your .profile (for sh).  The above line says
  127.  
  128.  
  129.  
  130.                        July 21, 1991
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                            - 3 -
  137.  
  138.  
  139. that if you are dialing in you are on a 2621, but if you are
  140. on  a  hardwired  terminal it figures out your terminal type
  141. from an on-line list.
  142.  
  143. _3._2.  _T_h_e _C _S_h_e_l_l
  144.  
  145. To manually set your terminal type to 2621 you would type:
  146.  
  147.         setenv TERM 2621
  148.  
  149.  
  150.      There are various ways of having this automatically  or
  151. semi-automatically  done  when you log in.  Suppose you usu-
  152. ally dial in on a 2621.   You  want  to  tell  this  to  the
  153. machine,  but  still  have  it work when you use a hardwired
  154. terminal.  The recommended way, if you have  the  _t_s_e_t  pro-
  155. gram, is to use the sequence
  156.  
  157.         tset -s -d 2621 > tset$$
  158.         source tset$$
  159.         rm tset$$
  160.  
  161. in your .login.* The above line says that if you are dialing
  162. in you are on a 2621, but if you are on a hardwired terminal
  163. it figures out your terminal type from an on-line list.
  164.  
  165. _4.  _N_o_r_m_a_l _C_o_m_m_a_n_d_s
  166.  
  167. Vi is a visual editor with a window on the file.   What  you
  168. see  on  the screen is vi's current notion of what your file
  169. will contain, (at this point in the file), when it is  writ-
  170. ten  out.   Most  commands  do  not  cause any change in the
  171. screen until the complete command is typed.  Should you  get
  172. confused  while  typing a command, you can abort the command
  173. by typing an <del> character.  You will know you are back to
  174. command  level  when  you  hear a <bell>.  Usually typing an
  175. <esc> will produce the same result.  When vi gets an improp-
  176. erly  formatted  command it rings the <bell>.  Following are
  177. the vi commands broken down by function.
  178.  
  179. _4._1.  _E_n_t_r_y _a_n_d _E_x_i_t
  180.  
  181. To enter _v_i on a particular _f_i_l_e, type
  182.  
  183.         vi _f_i_l_e
  184.  
  185. The file will be read in and the cursor will  be  placed  at
  186. the  beginning  of  the first line.  The first screenfull of
  187. the file will be displayed on the terminal.
  188. _________________________
  189. * On a version 6 system without environments, the invo-
  190. cation  of tset is simpler, just add the line ``tset -d
  191. 2621'' to your .login or .profile.
  192.  
  193.  
  194.  
  195.  
  196.                        July 21, 1991
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                            - 4 -
  203.  
  204.  
  205.      To get out of the editor, type
  206.  
  207.         ZZ
  208.  
  209. If you are in some special mode, such as input mode  or  the
  210. middle  of a multi-keystroke command, it may be necessary to
  211. type <esc> first.
  212.  
  213. _4._2.  _C_u_r_s_o_r _a_n_d _P_a_g_e _M_o_t_i_o_n
  214.  
  215. _N_O_T_E: The arrow keys (see the next four commands) on certain
  216. kinds  of terminals will not work with the PDP-11 version of
  217. vi.  The control versions or the hjkl versions will work  on
  218. any  terminal.   Experienced  users  prefer  the  hjkl  keys
  219. because  they  are  always  right   under   their   fingers.
  220. Beginners  often  prefer  the  arrow keys, since they do not
  221. require memorization  of  which  hjkl  key  is  which.   The
  222. mnemonic value of hjkl is clear from looking at the keyboard
  223. of an adm3a.
  224.  
  225.  
  226. [cnt]<bs> or [cnt]h or [cnt]<-
  227.                 Move the cursor to the left  one  character.
  228.                 Cursor stops at the left margin of the page.
  229.                 If cnt is given, these  commands  move  that
  230.                 many spaces.
  231.  
  232. [cnt]^N or [cnt]j or [cnt] or [cnt]<lf>
  233.                 Move down one line.  Moving off  the  screen
  234.                 scrolls  the window to force a new line onto
  235.                 the screen.  Mnemonic: Next
  236.  
  237. [cnt]^P or [cnt]k or [cnt]|^
  238.                 Move up one line.  Moving off the top of the
  239.                 screen  forces  new  text  onto  the screen.
  240.                 Mnemonic: Previous
  241.  
  242. [cnt]<sp> or [cnt]l or [cnt]->
  243.                 Move to the  right  one  character.   Cursor
  244.                 will not go beyond the end of the line.
  245.  
  246. [cnt]-          Move the cursor up the screen to the  begin-
  247.                 ning of the next line.  Scroll if necessary.
  248.  
  249. [cnt]+ or [cnt]<cr>
  250.  
  251.                 Move the  cursor  down  the  screen  to  the
  252.                 beginning  of  the  next line.  Scroll up if
  253.                 necessary.
  254.  
  255. [cnt]$          Move the cursor to the end of the line.   If
  256.                 there  is  a  count,  move to the end of the
  257.                 line "cnt" lines forward in the file.
  258.  
  259.  
  260.  
  261.  
  262.                        July 21, 1991
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                            - 5 -
  269.  
  270.  
  271. ^               Move the cursor  to  the  beginning  of  the
  272.                 first word on the line.
  273.  
  274. 0               Move the cursor to the left  margin  of  the
  275.                 current line.
  276.  
  277. [cnt]|          Move the cursor to the column  specified  by
  278.                 the count.  The default is column zero.
  279.  
  280. [cnt]w          Move the cursor to the beginning of the next
  281.                 word. If there is a count, then move forward
  282.                 that many words and position the  cursor  at
  283.                 the  beginning of the word.  Mnemonic: next-
  284.                 word
  285.  
  286. [cnt]W          Move the cursor to the beginning of the next
  287.                 word   which   follows   a   "white   space"
  288.                 (<sp>,<tab>, or <nl>).  Ignore  other  punc-
  289.                 tuation.
  290.  
  291. [cnt]b          Move  the  cursor  to  the  preceding  word.
  292.                 Mnemonic: backup-word
  293.  
  294. [cnt]B          Move the cursor to the preceding  word  that
  295.                 is  separated  from  the  current  word by a
  296.                 "white space" (<sp>,<tab>, or <nl>).
  297.  
  298. [cnt]e          Move the cursor to the end  of  the  current
  299.                 word  or the end of the "cnt"'th word hence.
  300.                 Mnemonic: end-of-word
  301.  
  302. [cnt]E          Move the cursor to the end  of  the  current
  303.                 word  which  is  delimited  by "white space"
  304.                 (<sp>,<tab>, or <nl>).
  305.  
  306. [line number]G
  307.                 Move the cursor to the line  specified.   Of
  308.                 particular  use  are  the sequences "1G" and
  309.                 "G", which move the cursor to the  beginning
  310.                 and   the  end  of  the  file  respectively.
  311.                 Mnemonic: Go-to
  312.  
  313. _N_O_T_E: The next four commands (^D, ^U, ^F, ^B) are  not  true
  314. motion  commands,  in that they cannot be used as the object
  315. of commands such as delete or change.
  316.  
  317. [cnt]^D         Move the cursor down in the  file  by  "cnt"
  318.                 lines  (or  the  last  "cnt"  if a new count
  319.                 isn't given.  The initial default is half  a
  320.                 page.)    The   screen   is   simultaneously
  321.                 scrolled up.  Mnemonic: Down
  322.  
  323. [cnt]^U         Move the cursor up  in  the  file  by  "cnt"
  324.                 lines.    The   screen   is   simultaneously
  325.  
  326.  
  327.  
  328.                        July 21, 1991
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                            - 6 -
  335.  
  336.  
  337.                 scrolled down.  Mnemonic: Up
  338.  
  339. [cnt]^F         Move the cursor to the next page.   A  count
  340.                 moves  that  many  pages.   Two lines of the
  341.                 previous page are kept  on  the  screen  for
  342.                 continuity  if possible.  Mnemonic: Forward-
  343.                 a-page
  344.  
  345. [cnt]^B         Move the cursor to the previous  page.   Two
  346.                 lines of the current page are kept if possi-
  347.                 ble.  Mnemonic: Backup-a-page
  348.  
  349. [cnt](          Move the cursor to the beginning of the next
  350.                 sentence.   A  sentence is defined as ending
  351.                 with a ".", "!",  or  "?"  followed  by  two
  352.                 spaces or a <nl>.
  353.  
  354. [cnt])          Move the cursor backwards to  the  beginning
  355.                 of a sentence.
  356.  
  357. [cnt]}          Move the cursor to the beginning of the next
  358.                 paragraph.   This  command works best inside
  359.                 nroff documents.  It understands two sets of
  360.                 nroff  macros,  -ms  and  -mm, for which the
  361.                 commands ".IP", ".LP", ".PP", ".QP", "P", as
  362.                 well  as  the  nroff  command ".bp" are con-
  363.                 sidered to be paragraph delimiters.  A blank
  364.                 line  also  delimits a paragraph.  The nroff
  365.                 macros that it accepts as  paragraph  delim-
  366.                 iters  is  adjustable.  See paragraphs under
  367.                 the Set Commands section.
  368.  
  369. [cnt]{          Move the cursor backwards to  the  beginning
  370.                 of a paragraph.
  371.  
  372. ]]              Move the cursor to the next "section", where
  373.                 a  section  is  defined by two sets of nroff
  374.                 macros, -ms and -mm, in which ".NH",  ".SH",
  375.                 and  ".H"  delimit a section.  A line begin-
  376.                 ning with a <ff><nl>  sequence,  or  a  line
  377.                 beginning  with a "{" are also considered to
  378.                 be  section  delimiters.   The  last  option
  379.                 makes  it  useful for finding the beginnings
  380.                 of C functions.  The nroff macros  that  are
  381.                 used for section delimiters can be adjusted.
  382.                 See sections under the Set Commands section.
  383.  
  384. [[              Move the cursor backwards to  the  beginning
  385.                 of a section.
  386.  
  387. %               Move the cursor to the matching  parenthesis
  388.                 or  brace.  This is very useful in C or lisp
  389.                 code.  If the cursor is sitting on a (  )  {
  390.                 or  }  the  cursor  is moved to the matching
  391.  
  392.  
  393.  
  394.                        July 21, 1991
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                            - 7 -
  401.  
  402.  
  403.                 character at the other end of  the  section.
  404.                 If the cursor is not sitting on a brace or a
  405.                 parenthesis, vi searches  forward  until  it
  406.                 finds one and then jumps to the match mate.
  407.  
  408. [cnt]H          If there is no count move the cursor to  the
  409.                 top  left  position on the screen.  If there
  410.                 is a count, then  move  the  cursor  to  the
  411.                 beginning  of  the line "cnt" lines from the
  412.                 top of the screen.  Mnemonic:  Home
  413.  
  414. [cnt]L          If there is no count move the cursor to  the
  415.                 beginning  of  the  last line on the screen.
  416.                 If there is a count, then move the cursor to
  417.                 the  beginning  of the line "cnt" lines from
  418.                 the bottom of the screen.  Mnemonic: Last
  419.  
  420. M               Move the cursor to the beginning of the mid-
  421.                 dle line on the screen.  Mnemonic: Middle
  422.  
  423. m<a-z>          This command does not move the  cursor,  but
  424.                 it marks the place in the file and the char-
  425.                 acter "<a-z>" becomes the label  for  refer-
  426.                 ring  to this location in the file.  See the
  427.                 next two commands.  Mnemonic: mark _N_O_T_E: The
  428.                 mark  command is not a motion, and cannot be
  429.                 used as  the  target  of  commands  such  as
  430.                 delete.
  431.  
  432. '<a-z>          Move the cursor to the beginning of the line
  433.                 that is marked with the label "<a-z>".
  434.  
  435. `<a-z>          Move the cursor to the exact position on the
  436.                 line  that  was  marked  with with the label
  437.                 "<a-z>".
  438.  
  439. ''              Move the cursor back to the beginning of the
  440.                 line  where  it  was  before  the last "non-
  441.                 relative" move.  A  "non-relative"  move  is
  442.                 something  such  as  a search or a jump to a
  443.                 specific line in the file, rather than  mov-
  444.                 ing the cursor or scrolling the screen.
  445.  
  446. ``              Move the cursor back to the  exact  spot  on
  447.                 the  line  where  it  was located before the
  448.                 last "non-relative" move.
  449.  
  450. _4._3.  _S_e_a_r_c_h_e_s
  451.  
  452. The following commands allow you to search for  items  in  a
  453. file.
  454.  
  455. [cnt]f{chr}
  456.  
  457.  
  458.  
  459.  
  460.                        July 21, 1991
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                            - 8 -
  467.  
  468.  
  469.                 Search forward on the line for the  next  or
  470.                 "cnt"'th  occurrence of the character "chr".
  471.                 The cursor is placed  at  the  character  of
  472.                 interest.  Mnemonic: find character
  473.  
  474. [cnt]F{chr}
  475.  
  476.                 Search backwards on the line for the next or
  477.                 "cnt"'th  occurrence of the character "chr".
  478.                 The cursor is placed  at  the  character  of
  479.                 interest.
  480.  
  481. [cnt]t{chr}
  482.  
  483.                 Search forward on the line for the  next  or
  484.                 "cnt"'th  occurrence of the character "chr".
  485.                 The cursor  is  placed  just  preceding  the
  486.                 character  of interest.  Mnemonic: move cur-
  487.                 sor up to character
  488.  
  489. [cnt]T{chr}
  490.  
  491.                 Search backwards on the line for the next or
  492.                 "cnt"'th  occurrence of the character "chr".
  493.                 The cursor  is  placed  just  preceding  the
  494.                 character of interest.
  495.  
  496. [cnt];          Repeat the last "f", "F", "t"  or  "T"  com-
  497.                 mand.
  498.  
  499. [cnt],          Repeat the last "f", "F", "t"  or  "T"  com-
  500.                 mand,  but in the opposite search direction.
  501.                 This is useful if you overshoot.
  502.  
  503. [cnt]/[string]/<nl>
  504.                 Search forward for the  next  occurrence  of
  505.                 "string".   Wrap  around  at  the end of the
  506.                 file does  occur.   The  final  </>  is  not
  507.                 required.
  508.  
  509. [cnt]?[string]?<nl>
  510.                 Search backwards for the next occurrence  of
  511.                 "string".   If  a  count  is  specified, the
  512.                 count becomes the  new  window  size.   Wrap
  513.                 around  at  the  beginning  of the file does
  514.                 occur.  The final <?> is not required.
  515.  
  516. n               Repeat the  last  /[string]/  or  ?[string]?
  517.                 search.  Mnemonic: next occurrence.
  518.  
  519. N               Repeat the  last  /[string]/  or  ?[string]?
  520.                 search, but in the reverse direction.
  521.  
  522. :g/[string]/[editor command]<nl>
  523.  
  524.  
  525.  
  526.                        July 21, 1991
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                            - 9 -
  533.  
  534.  
  535.                 Using the : syntax it is possible to do glo-
  536.                 bal searches ala the standard UNIX "ed" edi-
  537.                 tor.
  538.  
  539. _4._4.  _T_e_x_t _I_n_s_e_r_t_i_o_n
  540.  
  541. The following commands allow for the insertion of text.  All
  542. multicharacter  text insertions are terminated with an <esc>
  543. character.  The last change can always be undone by typing a
  544. u.  The text insert in insertion mode can contain newlines.
  545.  
  546. a{text}<esc>    Insert text immediately following the cursor
  547.                 position.  Mnemonic: append
  548.  
  549. A{text}<esc>    Insert text at the end of the current  line.
  550.                 Mnemonic: Append
  551.  
  552. i{text}<esc>    Insert text immediately preceding the cursor
  553.                 position.  Mnemonic: insert
  554.  
  555. I{text}<esc>    Insert text at the beginning of the  current
  556.                 line.
  557.  
  558. o{text}<esc>    Insert a new line after the  line  on  which
  559.                 the  cursor  appears  and insert text there.
  560.                 Mnemonic:  open new line
  561.  
  562. O{text}<esc>    Insert a new  line  preceding  the  line  on
  563.                 which  the  cursor  appears  and insert text
  564.                 there.
  565.  
  566. _4._5.  _T_e_x_t _D_e_l_e_t_i_o_n
  567.  
  568. The following commands allow the  user  to  delete  text  in
  569. various  ways.   All  changes can always be undone by typing
  570. the u command.
  571.  
  572. [cnt]x          Delete the character or characters  starting
  573.                 at the cursor position.
  574.  
  575. [cnt]X          Delete the character or characters  starting
  576.                 at  the character preceding the cursor posi-
  577.                 tion.
  578.  
  579. D               Deletes the remainder of the  line  starting
  580.                 at the cursor.  Mnemonic: Delete the rest of
  581.                 line
  582.  
  583. [cnt]d{motion}
  584.                 Deletes  one  or  more  occurrences  of  the
  585.                 specified  motion.  Any motion from sections
  586.                 4.1 and 4.2 can be used here.  The d can  be
  587.                 stuttered   (e.g.  [cnt]dd)  to  delete  cnt
  588.                 lines.
  589.  
  590.  
  591.  
  592.                        July 21, 1991
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                            - 10 -
  599.  
  600.  
  601. _4._6.  _T_e_x_t _R_e_p_l_a_c_e_m_e_n_t
  602.  
  603. The following commands  allow  the  user  to  simultaneously
  604. delete  and insert new text.  All such actions can be undone
  605. by typing u following the command.
  606.  
  607. r<chr>          Replaces the character at the current cursor
  608.                 position  with <chr>.  This is a one charac-
  609.                 ter replacement.  No <esc> is  required  for
  610.                 termination.  Mnemonic:  replace character
  611.  
  612. R{text}<esc>    Starts  overlaying  the  characters  on  the
  613.                 screen  with whatever you type.  It does not
  614.                 stop until an <esc> is typed.
  615.  
  616. [cnt]s{text}<esc>Substitute for "cnt"  characters  beginning
  617.                 at  the current cursor position.  A "$" will
  618.                 appear at the position in the text where the
  619.                 "cnt"'th  character appears so you will know
  620.                 how much you are erasing.  Mnemonic: substi-
  621.                 tute
  622.  
  623. [cnt]S{text}<esc>Substitute for the entire current line  (or
  624.                 lines).  If no count is given, a "$" appears
  625.                 at the end of the current line.  If a  count
  626.                 of more than 1 is given, all the lines to be
  627.                 replaced are deleted  before  the  insertion
  628.                 begins.
  629.  
  630. [cnt]c{motion}{text}<esc>
  631.                 Change the specified "motion"  by  replacing
  632.                 it  with  the  insertion  text.   A "$" will
  633.                 appear at the end of the last item  that  is
  634.                 being  deleted  unless the deletion involves
  635.                 whole lines.  Motion's  can  be  any  motion
  636.                 from  sections 4.1 or 4.2.  Stuttering the c
  637.                 (e.g. [cnt]cc) changes cnt lines.
  638.  
  639. _4._7.  _M_o_v_i_n_g _T_e_x_t
  640.  
  641. Vi provides a number  of  ways  of  moving  chunks  of  text
  642. around.   There  are  nine  buffers into which each piece of
  643. text which is deleted or "yanked" is put in addition to  the
  644. "undo"  buffer.   The most recent deletion or yank is in the
  645. "undo" buffer and also usually in buffer 1,  the  next  most
  646. recent  in buffer 2, and so forth.  Each new deletion pushes
  647. down all the older deletions.  Deletions older than 9 disap-
  648. pear.   There  is  also  a set of named registers, a-z, into
  649. which text can optionally  be  placed.   If  any  delete  or
  650. replacement  type  command is preceded by "<a-z>, that named
  651. buffer will contain the text deleted after  the  command  is
  652. executed.  For example, "a3dd will delete three lines start-
  653. ing at the current line and put them in  buffer  "a.*  There
  654. _________________________
  655.  
  656.  
  657.  
  658.                        July 21, 1991
  659.  
  660.  
  661.  
  662.  
  663.  
  664.                            - 11 -
  665.  
  666.  
  667. are two more basic commands and some  variations  useful  in
  668. getting and putting text into a file.
  669.  
  670. ["<a-z>][cnt]y{motion}
  671.  
  672.                 Yank the specified item or "cnt"  items  and
  673.                 put  in  the  "undo" buffer or the specified
  674.                 buffer.  The variety of "items" that can  be
  675.                 yanked  is  the  same  as  those that can be
  676.                 deleted with the "d" command or changed with
  677.                 the  "c" command.  In the same way that "dd"
  678.                 means delete the current line and "cc" means
  679.                 replace  the  current  line, "yy" means yank
  680.                 the current line.
  681.  
  682. ["<a-z>][cnt]Y  Yank the current line  or  the  "cnt"  lines
  683.                 starting  from  the  current  line.   If  no
  684.                 buffer is specified, they will go  into  the
  685.                 "undo" buffer, like any delete would.  It is
  686.                 equivalent to "yy".  Mnemonic:  Yank
  687.  
  688. ["<a-z>]p       Put "undo" buffer or  the  specified  buffer
  689.                 down  after the cursor.  If whole lines were
  690.                 yanked or deleted into the buffer, then they
  691.                 will  be  put down on the line following the
  692.                 line the cursor is on.   If  something  else
  693.                 was  deleted,  like a word or sentence, then
  694.                 it will be  inserted  immediately  following
  695.                 the cursor.  Mnemonic:  put buffer
  696.  
  697.                 It should be noted that text  in  the  named
  698.                 buffers remains there when you start editing
  699.                 a new file with the  :e  file<esc>  command.
  700.                 Since  this is so, it is possible to copy or
  701.                 delete text from one file and carry it  over
  702.                 to  another  file  in the buffers.  However,
  703.                 the undo buffer and the ability to undo  are
  704.                 lost when changing files.
  705.  
  706. ["<a-z>]P       Put "undo" buffer or  the  specified  buffer
  707.                 down  before  the  cursor.   If  whole lines
  708.                 where yanked or  deleted  into  the  buffer,
  709.                 then  they  will  be  put  down  on the line
  710.                 preceding the line the  cursor  is  on.   If
  711.                 something  else  was deleted, like a word or
  712.                 sentence, then it will be  inserted  immedi-
  713.                 ately preceding the cursor.
  714.  
  715. _________________________
  716. * Referring to an upper case letter as  a  buffer  name
  717. (A-Z)  is  the  same  as  referring  to  the lower case
  718. letter, except that text placed in such a buffer is ap-
  719. pended to it instead of replacing it.
  720.  
  721.  
  722.  
  723.  
  724.                        July 21, 1991
  725.  
  726.  
  727.  
  728.  
  729.  
  730.                            - 12 -
  731.  
  732.  
  733. [cnt]>{motion}  The shift operator will right shift all  the
  734.                 text  from  the  line on which the cursor is
  735.                 located to the  line  where  the  motion  is
  736.                 located.    The   text  is  shifted  by  one
  737.                 shiftwidth.  (See section 6.) >> means right
  738.                 shift the current line or lines.
  739.  
  740. [cnt]<{motion}  The shift operator will left shift  all  the
  741.                 text  from  the  line on which the cursor is
  742.                 located  to  the  line  where  the  item  is
  743.                 located.    The   text  is  shifted  by  one
  744.                 shiftwidth.  (See section 6.) << means  left
  745.                 shift  the  current line or lines.  Once the
  746.                 line has reached the left margin it  is  not
  747.                 further affected.
  748.  
  749. [cnt]={motion}  Prettyprints the indicated area according to
  750.                 _l_i_s_p conventions.  The area should be a lisp
  751.                 s-expression.
  752.  
  753. _4._8.  _M_i_s_c_e_l_l_a_n_e_o_u_s _C_o_m_m_a_n_d_s
  754.  
  755. Vi has a number of miscellaneous commands that are very use-
  756. ful.  They are:
  757.  
  758. ZZ              This is the normal way to exit from vi.   If
  759.                 any  changes  have  been  made,  the file is
  760.                 written out.  Then you are returned  to  the
  761.                 shell.
  762.  
  763. ^L              Redraw the current screen.  This  is  useful
  764.                 if  someone  "write"s  you  while you are in
  765.                 "vi" or if for any reason garbage gets  onto
  766.                 the screen.
  767.  
  768. ^R              On dumb  terminals,  those  not  having  the
  769.                 "delete  line" function (the vt100 is such a
  770.                 terminal), vi  saves  redrawing  the  screen
  771.                 when  you  delete a line by just marking the
  772.                 line with an "@" at the beginning and blank-
  773.                 ing  the  line.  If you want to actually get
  774.                 rid of the lines marked  with  "@"  and  see
  775.                 what  the  page looks like, typing a ^R will
  776.                 do this.
  777.  
  778. .               "Dot" is a particularly useful command.   It
  779.                 repeats  the  last  text  modifying command.
  780.                 Therefore you can type a  command  once  and
  781.                 then  to another place and repeat it by just
  782.                 typing ".".
  783.  
  784. u               Perhaps the most important  command  in  the
  785.                 editor,  u  undoes  the  last  command  that
  786.                 changed the buffer.  Mnemonic:  undo
  787.  
  788.  
  789.  
  790.                        July 21, 1991
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                            - 13 -
  797.  
  798.  
  799. U               Undo all the text  modifying  commands  per-
  800.                 formed  on  the  current line since the last
  801.                 time you moved onto it.
  802.  
  803. [cnt]J          Join the  current  line  and  the  following
  804.                 line.  The <nl> is deleted and the two lines
  805.                 joined, usually with a space between the end
  806.                 of  the first line and the beginning of what
  807.                 was the second  line.   If  the  first  line
  808.                 ended  with  a "period", then two spaces are
  809.                 inserted.  A count joins the next cnt lines.
  810.                 Mnemonic: Join lines
  811.  
  812. Q               Switch to ex editing mode.  In this mode  vi
  813.                 will  behave  very much like ed.  The editor
  814.                 in this mode will operate  on  single  lines
  815.                 normally  and  will  not attempt to keep the
  816.                 "window" up to date.  Once in this  mode  it
  817.                 is  also possible to switch to the open mode
  818.                 of editing.  By entering the  command  [line
  819.                 number]open<nl>  you enter this mode.  It is
  820.                 similar to the normal visual mode except the
  821.                 window  is  only  one  line long.  Mnemonic:
  822.                 Quit visual mode
  823.  
  824. ^]              An abbreviation for a tag command.  The cur-
  825.                 sor should be positioned at the beginning of
  826.                 a word.  That word is taken as a  tag  name,
  827.                 and the tag with that name is found as if it
  828.                 had been typed in a :tag command.
  829.  
  830. [cnt]!{motion}{UNIX cmd}<nl>
  831.                 Any UNIX filter (e.g. command that reads the
  832.                 standard  input and outputs something to the
  833.                 standard output) can be sent  a  section  of
  834.                 the  current file and have the output of the
  835.                 command replace the original  text.   Useful
  836.                 examples  are  programs  like  cb, sort, and
  837.                 nroff.  For instance, using sort it would be
  838.                 possible  to  sort  a section of the current
  839.                 file into a new list.  Using !! means take a
  840.                 line  or lines starting at the line the cur-
  841.                 sor is currently on and  pass  them  to  the
  842.                 UNIX  command.   _N_O_T_E: To just escape to the
  843.                 shell for one command, use :!{cmd}<nl>,  see
  844.                 section 5.
  845.  
  846. z{cnt}<nl>      This resets the current window size to "cnt"
  847.                 lines and redraws the screen.
  848.  
  849. _4._9.  _S_p_e_c_i_a_l _I_n_s_e_r_t _C_h_a_r_a_c_t_e_r_s
  850.  
  851. There are some characters that have special meanings  during
  852. insert modes.  They are:
  853.  
  854.  
  855.  
  856.                        July 21, 1991
  857.  
  858.  
  859.  
  860.  
  861.  
  862.                            - 14 -
  863.  
  864.  
  865. ^V              During inserts, typing a ^V  allows  you  to
  866.                 quote control characters into the file.  Any
  867.                 character  typed  after  the  ^V   will   be
  868.                 inserted into the file.
  869.  
  870. [^]^D or [0]^D  <^D>  without  any  argument  backs  up  one
  871.                 shiftwidth.   This  is  necessary  to remove
  872.                 indentation that was inserted by the autoin-
  873.                 dent feature.  ^<^D> temporarily removes all
  874.                 the autoindentation, thus placing the cursor
  875.                 at  the  left margin.  On the next line, the
  876.                 previous  indent  level  will  be  restored.
  877.                 This  is  useful for putting "labels" at the
  878.                 left margin.  0<^D> says remove all  autoin-
  879.                 dents  and  stay  that way.  Thus the cursor
  880.                 moves to the left margin and stays there  on
  881.                 successive  lines  until  <tab>'s are typed.
  882.                 As with the <tab>, the <^D> is  only  effec-
  883.                 tive  before any other "non-autoindent" con-
  884.                 trolling characters  are  typed.   Mnemonic:
  885.                 Delete a shiftwidth
  886.  
  887. ^W              If the cursor is sitting  on  a  word,  <^W>
  888.                 moves  the  cursor  back to the beginning of
  889.                 the word, thus erasing  the  word  from  the
  890.                 insert.  Mnemonic: erase Word
  891.  
  892. <bs>            The backspace always serves as an erase dur-
  893.                 ing  insert modes in addition to your normal
  894.                 "erase" character.  To insert  a  <bs>  into
  895.                 your file, use the <^V> to quote it.
  896.  
  897. _5.  : Commands
  898.  
  899. Typing a ":" during command mode causes vi to put the cursor
  900. at  the  bottom  on the screen in preparation for a command.
  901. In the ":" mode, vi can be given most ed  commands.   It  is
  902. also  from this mode that you exit from vi or switch to dif-
  903. ferent files.  All commands of this variety  are  terminated
  904. by a <nl>, <cr>, or <esc>.
  905.  
  906. :w[!] [file]    Causes vi to write out the current  text  to
  907.                 the disk.  It is written to the file you are
  908.                 editing  unless  "file"  is  supplied.    If
  909.                 "file" is supplied, the write is directed to
  910.                 that file instead.   If  that  file  already
  911.                 exists, vi will not perform the write unless
  912.                 the "!" is supplied  indicating  you  _r_e_a_l_l_y
  913.                 want to destroy the older copy of the file.
  914.  
  915. :q[!]           Causes vi to exit.  If you have modified the
  916.                 file   you  are  looking  at  currently  and
  917.                 haven't written it out, vi  will  refuse  to
  918.                 exit unless the "!" is supplied.
  919.  
  920.  
  921.  
  922.                        July 21, 1991
  923.  
  924.  
  925.  
  926.  
  927.  
  928.                            - 15 -
  929.  
  930.  
  931. :e[!] [+[cmd]] [file]
  932.  
  933.                 Start editing a new file  called  "file"  or
  934.                 start  editing  the current file over again.
  935.                 The command ":e!" says "ignore  the  changes
  936.                 I've  made  to this file and start over from
  937.                 the beginning".  It is useful if you  really
  938.                 mess  up  the  file.   The optional "+" says
  939.                 instead of starting at the beginning,  start
  940.                 at the "end", or, if "cmd" is supplied, exe-
  941.                 cute "cmd" first.  Useful cases of this  are
  942.                 where  cmd is "n" (any integer) which starts
  943.                 at  line  number  n,  and   "/text",   which
  944.                 searches  for  "text" and starts at the line
  945.                 where it is found.
  946.  
  947. ^^              Switch back to the  place  you  were  before
  948.                 your  last  tag  command.   If your last tag
  949.                 command stayed within the file,  ^^  returns
  950.                 to that tag.  If you have no recent tag com-
  951.                 mand, it will return to the  same  place  in
  952.                 the  previous  file that it was showing when
  953.                 you switched to the current file.
  954.  
  955. :n[!]           Start editing the next file in the  argument
  956.                 list.   Since vi can be called with multiple
  957.                 file names, the ":n"  command  tells  it  to
  958.                 stop  work on the current file and switch to
  959.                 the next file.   If  the  current  file  was
  960.                 modifies,  it  has  to be written out before
  961.                 the ":n" will work or else the "!"  must  be
  962.                 supplied,  which  says discard the changes I
  963.                 made to the current file.
  964.  
  965. :n[!] file [file file ...]
  966.  
  967.                 Replace the current argument list with a new
  968.                 list  of  files  and start editing the first
  969.                 file in this new list.
  970.  
  971. :r file         Read in a copy of "file" on the  line  after
  972.                 the cursor.
  973.  
  974. :r !cmd         Execute the "cmd" and take  its  output  and
  975.                 put it into the file after the current line.
  976.  
  977. :!cmd           Execute any UNIX shell command.
  978.  
  979. :ta[!] tag      _V_i looks in  the  file  named  _t_a_g_s  in  the
  980.                 current  directory.  _T_a_g_s is a file of lines
  981.                 in the format:
  982.  
  983.                         tag filename vi-search-command
  984.  
  985.  
  986.  
  987.  
  988.                        July 21, 1991
  989.  
  990.  
  991.  
  992.  
  993.  
  994.                            - 16 -
  995.  
  996.  
  997.                 If vi finds the tag you specified in the :ta
  998.                 command,  it  stops editing the current file
  999.                 if necessary and if the current file  is  up
  1000.                 to date on the disk and switches to the file
  1001.                 specified and uses the search pattern speci-
  1002.                 fied  to find the "tagged" item of interest.
  1003.                 This is  particularly  useful  when  editing
  1004.                 multi-file  C programs such as the operating
  1005.                 system.  There is  a  program  called  ctags
  1006.                 which will generate an appropriate tags file
  1007.                 for C and f77 programs so that by saying :ta
  1008.                 function<nl>  you  will  be switched to that
  1009.                 function.  It  could  also  be  useful  when
  1010.                 editing  multi-file  documents,  though  the
  1011.                 tags file would have to be  generated  manu-
  1012.                 ally.
  1013.  
  1014. _6.  _S_p_e_c_i_a_l _A_r_r_a_n_g_e_m_e_n_t_s _f_o_r _S_t_a_r_t_u_p
  1015.  
  1016.      Vi takes the value of $TERM and looks  up  the  charac-
  1017. teristics of that terminal in the file /etc/termcap.  If you
  1018. don't know vi's name for the terminal you  are  working  on,
  1019. look in /etc/termcap.
  1020.  
  1021.      When vi starts, it attempts to read the variable EXINIT
  1022. from  your environment.* If that exists, it takes the values
  1023. in it as the default values for certain of its internal con-
  1024. stants.   See  the  section  on  "Set  Values"  for  further
  1025. details.  If EXINIT doesn't exist you will get all the  nor-
  1026. mal defaults.
  1027.  
  1028.      Should you inadvertently hang up the phone while inside
  1029. _v_i, or should the computer crash, all may not be lost.  Upon
  1030. returning to the system, type:
  1031.  
  1032.         vi -r file
  1033.  
  1034. This will normally recover the file.  If there is more  than
  1035. one temporary file for a specific file name, vi recovers the
  1036. newest one.  You can get an older version by recovering  the
  1037. file  more  than  once.   The command "vi -r" without a file
  1038. name gives you the list of files that were saved in the last
  1039. system crash (but _n_o_t the file just saved when the phone was
  1040. hung up).
  1041.  
  1042. _7.  _S_e_t _C_o_m_m_a_n_d_s
  1043.  
  1044. Vi has a number of internal variables and switches which can
  1045. be  set  to  achieve special affects.  These options come in
  1046. _________________________
  1047. * On version 6  systems  Instead  of  EXINIT,  put  the
  1048. startup  commands in the file .exrc in your home direc-
  1049. tory.
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                        July 21, 1991
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.                            - 17 -
  1061.  
  1062.  
  1063. three forms, those that are switches, which toggle from  off
  1064. to  on  and  back,  those  that require a numeric value, and
  1065. those that require an alphanumeric string value.  The toggle
  1066. options are set by a command of the form:
  1067.  
  1068.         :set option<nl>
  1069.  
  1070. and turned off with the command:
  1071.  
  1072.         :set nooption<nl>
  1073.  
  1074. Commands requiring a value are set with  a  command  of  the
  1075. form:
  1076.  
  1077.         :set option=value<nl>
  1078.  
  1079. To display the value of a specific option type:
  1080.  
  1081.         :set option?<nl>
  1082.  
  1083. To display only those that you have changed type:
  1084.  
  1085.         :set<nl>
  1086.  
  1087. and to display the long table of all the settable parameters
  1088. and their current values type:
  1089.  
  1090.         :set all<nl>
  1091.  
  1092.  
  1093.      Most of the options have a long form and  an  abbrevia-
  1094. tion.  Both are listed in the following table as well as the
  1095. normal default value.
  1096.  
  1097.      To arrange to have values other than the  default  used
  1098. every  time  you enter _v_i, place the appropriate _s_e_t command
  1099. in EXINIT in your environment, e.g.
  1100.  
  1101.         EXINIT='set ai aw terse sh=/bin/csh'
  1102.         export EXINIT
  1103.  
  1104. or
  1105.  
  1106.         setenv EXINIT 'set ai aw terse sh=/bin/csh'
  1107.  
  1108. for _s_h and _c_s_h, respectively.  These are usually  placed  in
  1109. your  .profile  or  .login.   If  you  are  running a system
  1110. without environments (such as version 6) you can  place  the
  1111. set command in the file .exrc in your home directory.
  1112.  
  1113. autoindent ai   Default: noai Type: toggle
  1114.                 When in autoindent mode, vi helps you indent
  1115.                 code  by  starting  each  line  in  the same
  1116.                 column as the preceding  line.   Tabbing  to
  1117.  
  1118.  
  1119.  
  1120.                        July 21, 1991
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.                            - 18 -
  1127.  
  1128.  
  1129.                 the  right with <tab> or <^T> will move this
  1130.                 boundary to the right, and it can  be  moved
  1131.                 to the left with <^D>.
  1132.  
  1133. autoprint ap    Default: ap Type: toggle
  1134.                 Causes the current line to be printed  after
  1135.                 each ex text modifying command.  This is not
  1136.                 of much interest in  the  normal  vi  visual
  1137.                 mode.
  1138.  
  1139. autowrite aw    Default: noaw type: toggle
  1140.                 Autowrite causes an automatic  write  to  be
  1141.                 done  if  there  are  unsaved changes before
  1142.                 certain commands which change files or  oth-
  1143.                 erwise  interact  with  the  outside  world.
  1144.                 These commands are :!, :tag, :next, :rewind,
  1145.                 ^^, and ^].
  1146.  
  1147. beautify bf     Default: nobf Type: toggle
  1148.                 Causes all control characters except  <tab>,
  1149.                 <nl>, and <ff> to be discarded.
  1150.  
  1151. directory dir   Default: dir=/tmp Type: string
  1152.                 This is the directory in which vi  puts  its
  1153.                 temporary file.
  1154.  
  1155. errorbells eb   Default: noeb Type: toggle
  1156.                 Error messages are preceded by a <bell>.
  1157.  
  1158. hardtabs ht     Default: hardtabs=8 Type: numeric
  1159.                 This option contains the value  of  hardware
  1160.                 tabs  in  your terminal, or of software tabs
  1161.                 expanded by the Unix system.
  1162.  
  1163. ignorecase ic   Default: noic Type: toggle
  1164.                 All upper  case  characters  are  mapped  to
  1165.                 lower case in regular expression matching.
  1166.  
  1167. lisp            Default: nolisp Type: toggle
  1168.                 Autoindent for lisp code.  The commands (  )
  1169.                 [[  and  ]]  are  modified  appropriately to
  1170.                 affect s-expressions and functions.
  1171.  
  1172. list            Default: nolist Type: toggle
  1173.                 All printed lines have the  <tab>  and  <nl>
  1174.                 characters displayed visually.
  1175.  
  1176. magic           Default: magic Type: toggle
  1177.                 Enable  the  metacharacters  for   matching.
  1178.                 These include . * < > [string] [^string] and
  1179.                 [<chr>-<chr>].
  1180.  
  1181. number nu       Default: nonu Type: toggle
  1182.                 Each line is displayed with its line number.
  1183.  
  1184.  
  1185.  
  1186.                        July 21, 1991
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.                            - 19 -
  1193.  
  1194.  
  1195. open            Default: open Type: toggle
  1196.                 When set, prevents entering open  or  visual
  1197.                 modes from ex or edit.  Not of interest from
  1198.                 vi.
  1199.  
  1200. optimize opt    Default: opt Type: toggle
  1201.                 Basically of use  only  when  using  the  ex
  1202.                 capabilities.     This    option    prevents
  1203.                 automatic  <cr>s  from  taking  place,   and
  1204.                 speeds  up  output of indented lines, at the
  1205.                 expense of losing typeahead on some versions
  1206.                 of UNIX.
  1207.  
  1208. paragraphs para Default: para=IPLPPPQPP bp Type: string
  1209.                 Each pair of characters in the string  indi-
  1210.                 cate nroff macros which are to be treated as
  1211.                 the beginning of a paragraph for the { and }
  1212.                 commands.  The default string is for the -ms
  1213.                 and -mm  macros.   To  indicate  one  letter
  1214.                 nroff  macros,  such  as  .P  or .H, quote a
  1215.                 space in for the second character  position.
  1216.                 For example:
  1217.  
  1218.                         :set paragraphs=P\ bp<nl>
  1219.  
  1220.                 would cause vi to consider  .P  and  .bp  as
  1221.                 paragraph delimiters.
  1222.  
  1223. prompt          Default: prompt Type: toggle
  1224.                 In _e_x command mode the  prompt  character  :
  1225.                 will  be  printed  when  ex is waiting for a
  1226.                 command.  This is not of interest from vi.
  1227.  
  1228. redraw          Default: noredraw Type: toggle
  1229.                 On  dumb  terminals,  force  the  screen  to
  1230.                 always  be  up  to  date,  by  sending great
  1231.                 amounts of  output.   Useful  only  at  high
  1232.                 speeds.
  1233.  
  1234. report          Default: report=5 Type: numeric
  1235.                 This sets the threshold for  the  number  of
  1236.                 lines  modified.  When more than this number
  1237.                 of lines are modified, removed,  or  yanked,
  1238.                 vi  will  report the number of lines changed
  1239.                 at the bottom of the screen.
  1240.  
  1241. scroll          Default: scroll={1/2 window} Type: numeric
  1242.                 This is the number of lines that the  screen
  1243.                 scrolls  up  or down when using the <^U> and
  1244.                 <^D> commands.
  1245.  
  1246. sections        Default: sections=SHNHH HU Type: string
  1247.                 Each  two  character  pair  of  this  string
  1248.                 specify  nroff  macro  names which are to be
  1249.  
  1250.  
  1251.  
  1252.                        July 21, 1991
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                            - 20 -
  1259.  
  1260.  
  1261.                 treated as the beginning of a section by the
  1262.                 ]]  and  [[ commands.  The default string is
  1263.                 for the -ms and -mm macros.   To  enter  one
  1264.                 letter  nroff  macros, use a quoted space as
  1265.                 the second character.  See paragraphs for  a
  1266.                 fuller explanation.
  1267.  
  1268. shell sh        Default:  sh=from   environment   SHELL   or
  1269.                 /bin/sh   Type: string
  1270.                 This is the name of the sh to  be  used  for
  1271.                 "escaped" commands.
  1272.  
  1273. shiftwidth sw   Default: sw=8 Type: numeric
  1274.                 This is the number of spaces that a <^T>  or
  1275.                 <^D>  will  move over for indenting, and the
  1276.                 amount < and > shift by.
  1277.  
  1278. showmatch sm    Default: nosm Type: toggle
  1279.                 When a ) or } is typed, show the matching  (
  1280.                 or  {  by  moving  the  cursor to it for one
  1281.                 second if it is on the current screen.
  1282.  
  1283. slowopen slow   Default: terminal dependent Type: toggle
  1284.                 On terminals that are  slow  and  unintelli-
  1285.                 gent,  this  option prevents the updating of
  1286.                 the screen  some  of  the  time  to  improve
  1287.                 speed.
  1288.  
  1289. tabstop ts      Default: ts=8 Type: numeric
  1290.                 <tab>s are expanded to boundaries  that  are
  1291.                 multiples of this value.
  1292.  
  1293. taglength tl    Default: tl=0 Type: numeric
  1294.                 If nonzero, tag names are  only  significant
  1295.                 to this many characters.
  1296.  
  1297. term            Default: (from environment TERM, else  dumb)
  1298.                 Type: string
  1299.                 This is the terminal and controls the visual
  1300.                 displays.   It  cannot  be  changed  when in
  1301.                 "visual" mode, you  have  to  Q  to  command
  1302.                 mode,  type  a  set  term  command,  and  do
  1303.                 ``vi.'' to get back into  visual.   Or  exit
  1304.                 vi, fix $TERM, and reenter.  The definitions
  1305.                 that drive a particular  terminal  type  are
  1306.                 found in the file /etc/termcap.
  1307.  
  1308. terse           Default: terse Type: toggle
  1309.                 When set, the error diagnostics are short.
  1310.  
  1311. warn            Default: warn Type: toggle
  1312.                 The user is warned if she/he tries to escape
  1313.                 to the shell without writing out the current
  1314.                 changes.
  1315.  
  1316.  
  1317.  
  1318.                        July 21, 1991
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.                            - 21 -
  1325.  
  1326.  
  1327. window          Default: window={8 at 600 baud or  less,  16
  1328.                 at  1200  baud,  and screen size - 1 at 2400
  1329.                 baud or more} Type: numeric
  1330.                 This is the number of lines  in  the  window
  1331.                 whenever  vi  must  redraw an entire screen.
  1332.                 It is useful to make this  size  smaller  if
  1333.                 you are on a slow line.
  1334.  
  1335. w300, w1200, w9600
  1336.                 These  set  window,  but  only  within   the
  1337.                 corresponding speed ranges.  They are useful
  1338.                 in an EXINIT to fine tune window sizes.  For
  1339.                 example,
  1340.  
  1341.                         set w300=4 w1200=12
  1342.  
  1343.                 causes a 4 lines window at speed up  to  600
  1344.                 baud,  a  12 line window at 1200 baud, and a
  1345.                 full screen (the default) at over 1200 baud.
  1346.  
  1347. wrapscan ws     Default: ws Type: toggle
  1348.                 Searches will wrap around  the  end  of  the
  1349.                 file when is option is set.  When it is off,
  1350.                 the search will terminate  when  it  reaches
  1351.                 the end or the beginning of the file.
  1352.  
  1353. wrapmargin wm   Default: wm=0 Type: numeric
  1354.                 Vi will automatically insert a <nl> when  it
  1355.                 finds  a natural break point (usually a <sp>
  1356.                 between  words)  that  occurs  within   "wm"
  1357.                 spaces  of the right margin.  Therefore with
  1358.                 "wm=0" the option is off.  Setting it to  10
  1359.                 would  mean  that any time you are within 10
  1360.                 spaces of the right margin vi would be look-
  1361.                 ing  for  a  <sp>  or  <tab>  which it could
  1362.                 replace with a <nl>.  This is convenient for
  1363.                 people  who  forget  to  look  at the screen
  1364.                 while they type.  (In version 3,  wrapmargin
  1365.                 behaves  more  like nroff, in that the boun-
  1366.                 dary specified  by  the  distance  from  the
  1367.                 right  edge  of  the  screen is taken as the
  1368.                 rightmost edge of the area where a break  is
  1369.                 allowed, instead of the leftmost edge.)
  1370.  
  1371. writeany wa     Default: nowa Type: toggle
  1372.                 Vi normally makes a number of checks  before
  1373.                 it  writes  out  a  file.  This prevents the
  1374.                 user from inadvertently destroying  a  file.
  1375.                 When the "writeany" option is enabled, vi no
  1376.                 longer makes these checks.
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                        July 21, 1991
  1385.  
  1386.  
  1387.  chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chanrite plesut " chan