home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / Documents / Others / viCourse+ / vi-Course.txt < prev    next >
Text File  |  1993-01-25  |  130KB  |  6,339 lines

  1.  
  2.  
  3.         #     #   ###
  4.         #     #    #
  5.         #     #    #
  6.         #     #    #
  7.          #   #     #
  8.           # #      #
  9.            #      ###
  10.         
  11.     
  12.     
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.           ####    ####   #    #  #####    ####   ######
  23.          #    #  #    #  #    #  #    #  #       #
  24.          #       #    #  #    #  #    #   ####   #####
  25.          #       #    #  #    #  #####        #  #
  26.          #    #  #    #  #    #  #   #   #    #  #
  27.           ####    ####    ####   #    #   ####   ######
  28.  
  29.  
  30.  
  31.  
  32.  
  33.         Developed by Analytical Evaluation Branch, FSAC
  34.         Revision 2.1    13 Nov 1989
  35.         Author:        Dennis G. Rears
  36.         EMail Address:    <drears@pica.army.mil>
  37.         Phone:        (201) 724-2683
  38.         UPS:        Box 210, Wharton, NJ  07885
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.             VI Course
  47.  
  48.  
  49.         Revision History
  50.  
  51.     2.1    13 Nov 1989   Dennis Rears   <drears>
  52.  
  53.         Minor corrections.
  54.  
  55.     2.0    27 June 1989  Dennis Rears   <drears>
  56.  
  57.            Changed representation of control characters to CTRL.
  58.            Expanded EX section.
  59.     
  60.  
  61.  
  62.     1.1    21 Mar 1989  Dennis Rears
  63.  
  64.            Rewrote course, greatly expanding "outline".
  65.  
  66.  
  67.     1.0     Circa 1988  Dennis Rears
  68.  
  69.         Original Course.
  70.  
  71.  
  72.  
  73.  
  74.         Developed by Analytical Evaluation Branch, FSAC
  75.         Host:        caesar.pica.army.mil
  76.         Location:    /u1/drears/teach/vi/course
  77.         Author:        Dennis G. Rears
  78.         EMail Address:    <drears@pica.army.mil>
  79.         Phone:        (201) 724-2683
  80.         Date:          27 June 1989
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.             VI Course
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.         Table of Contents
  103.  
  104.  
  105.         1) Introduction
  106.  
  107.         2) Navigation
  108.  
  109.         3) Inserting Text
  110.  
  111.         4) Deleting/Changing Text
  112.  
  113.         5) Other Functions
  114.  
  115.            6) Ex Mode
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.   ####   #    #    ##    #####    #####  ######  #####            ##
  124.  #    #  #    #   #  #   #    #     #    #       #    #          # #
  125.  #       ######  #    #  #    #     #    #####   #    #            #
  126.  #       #    #  ######  #####      #    #       #####             #
  127.  #    #  #    #  #    #  #          #    #       #   #             #
  128.   ####   #    #  #    #  #          #    ######  #    #          #####
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.     #    #    #   #####  #####    ####
  138.     #    ##   #     #    #    #  #    #
  139.     #    # #  #     #    #    #  #    #
  140.     #    #  # #     #    #####   #    #
  141.     #    #   ##     #    #   #   #    #
  142.     #    #    #     #    #    #   ####
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.             INTRODUCTION
  152.  
  153.  
  154.  
  155.         o Ed Family of Editors
  156.  
  157.             o e
  158.             o edit
  159.             o ex
  160.             o view
  161.             o vi
  162.  
  163.  
  164.         o Full Screen Editor
  165.  
  166.             o Terminal Type
  167.  
  168.  
  169.         o Developed by UC at Berkeley
  170.             
  171.             o Bill Joy
  172.             o Mike Horton
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.             
  183.             Important Terms
  184.  
  185.  
  186.  
  187.  
  188.  
  189.     
  190.     o VI - VIsual Editor, a full screen editor used by all UNIX
  191.         systems.
  192.  
  193.     o shell - The command processor.
  194.  
  195.     o shell escape - An action that allows the user to issue a
  196.     shell command from a running program. 
  197.  
  198.     o buffer - A temporary place to store info.
  199.  
  200.     o file - A permament place to store data.
  201.  
  202.     o unix - The operating system in use on ARDEC workplace
  203.         automation machines.
  204.  
  205.     o Control Character - A character represented by "CTRL X".
  206.     To make the character the Control and letter key must be
  207.     hit at the same time.
  208.  
  209.     o White Space - A tab, space, or new line character.
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.             Modes
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.          VI works in three different modes. They are:
  227.  
  228.  
  229.             o  Insert Mode -  This mode is used when
  230.         appending, inserting, changing, and replacing text. 
  231.  
  232.             o  Ex Mode -  This mode allows for use of 
  233.         the ex set of commands.  This mode can act on one line
  234.         at a time, several lines at a time, or every line.
  235.         Shell escapes are executed at this level.
  236.  
  237.             o  Command Mode - Vi begins in this mode.
  238.         This mode allows you to switch to the other modes.  
  239.         In addition, deleting, transposing, yanking, and 
  240.         other functions are performed here.
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.             IMPORTANT KEYS
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.         o  ESCAPE - Exits insert mode.
  260.  
  261.         o  COLON - Enters ex mode.
  262.  
  263.         o  BANG (!) - shell escape.
  264.  
  265.         o  TILDE (~) - no line is present as opposed
  266.                    to nothing on the line. 
  267.  
  268.         o  CTRL L - screen refresh or form feed.
  269.  
  270.  
  271.            CTRL L indicates that the "L" key and the
  272.         Control key are depressed at the same time.
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  #####                                                           #####
  281. #     #  #    #    ##    #####    #####  ######  #####          #     #
  282. #        #    #   #  #   #    #     #    #       #    #               #
  283. #        ######  #    #  #    #     #    #####   #    #          #####
  284. #        #    #  ######  #####      #    #       #####          #
  285. #     #  #    #  #    #  #          #    #       #   #          #
  286.  #####   #    #  #    #  #          #    ######  #    #         #######
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296. #     #
  297. ##    #    ##    #    #     #     ####     ##     #####     #     ####   #    #
  298. # #   #   #  #   #    #     #    #    #   #  #      #       #    #    #  ##   #
  299. #  #  #  #    #  #    #     #    #       #    #     #       #    #    #  # #  #
  300. #   # #  ######  #    #     #    #  ###  ######     #       #    #    #  #  # #
  301. #    ##  #    #   #  #      #    #    #  #    #     #       #    #    #  #   ##
  302. #     #  #    #    ##       #     ####   #    #     #       #     ####   #    #
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.             What is a line?
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.         o  Physical Line -  the maximum characters
  323.         your screen can hold in a line.
  324.  
  325.         o  Logical Line  -  A line terminated by the <CR> 
  326.         character.
  327.  
  328.         o  At most, one logical line can fit into one
  329.         physical line but physical line can fit into 
  330.         a logical line.
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.              Navigation
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.         o  VI lets you move the cursor a character, word,
  349.                  line, or region at a time.
  350.  
  351.         o  As with other functions keys, a numeric count can
  352.            be added before the key to repeat the function.
  353.  
  354.         o  Example:
  355.  
  356.             o h will move the cursor back 1 character
  357.  
  358.             o 4h will move the cursor back 4 characters
  359.  
  360.         o  VI will not let you navigate before the beginning
  361.         or end of the file.
  362.  
  363.  
  364.  
  365.  
  366.  
  367.             Navigation
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.         o  cursor keys
  379.  
  380.         o  home keys
  381.  
  382.             o h  -  1 space back        ***
  383.             o j  -  1 space down        ***
  384.             o k  -  1 space up        ***
  385.             o l  -  1 space forward        ***
  386.  
  387.         o  screen keys
  388.  
  389.             o H -  Home or 1st Line
  390.             o M -  Middle Line
  391.             o L -  Last Line
  392.  
  393.         o control keys
  394.  
  395.             o CTRL-B - back a screen
  396.             o CTRL-F - forward a screen
  397.             o CTRL-U - Up half a screen
  398.             o CTRL-D - Down half a screen
  399.  
  400.  
  401.         *** a numeric count can be added before the command.
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.             Navigation Within A Line
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.         o  Word Navigation (not including punctuation)
  420.  
  421.             o  b - back up a word
  422.  
  423.             o  e - forward to end of word
  424.  
  425.             o  w - forward to next word
  426.  
  427.  
  428.         o Bigger Word (includes punctuation)
  429.  
  430.  
  431.             o  B - back up a word
  432.  
  433.             o  E - forward to end of word
  434.  
  435.             o  W - forward to next word
  436.  
  437.         o Numeric count can be added before all of these commands
  438.           
  439.             o e.g. 5e - forward to end of fifth word.
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.             Navigating
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.         o  0  - First character of file.
  459.  
  460.         o  ^  - First non-whitespace character.
  461.  
  462.         o  $  - End of line.
  463.  
  464.         o  xG - line x of the file.
  465.  
  466.         o  G  - Last line of file.
  467.  
  468.         o  CTRL-G - Displays current info
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.                   Summary
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.             o  b  - back up a word
  491.             o  e  - forward to end of word
  492.             o  h  -  1 space back
  493.             o  j  -  1 space down
  494.             o  k  -  1 space up
  495.             o  l  -  1 space forward
  496.             o  w  - forward to next word
  497.  
  498.             o  B  - back up a word
  499.             o  E  - forward to end of word
  500.                 o  G  - last line of file
  501.             o  H  -  Home or 1st Line
  502.             o  L  -  Last Line
  503.             o  M  -  Middle Line
  504.             o  W  - forward to next word
  505.  
  506.             o  CTRL-B - Back a screen
  507.             o  CTRL-D - Forward 1/2 screen
  508.             o  CTRL-F - Forward a screen
  509.             o  CTRL-G - Displays current info
  510.             o  CTRL-U - Back 1/2 screen
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.             Navigating.
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.         Exercise #1  
  532.  
  533.         o  Use view instead of vi
  534.  
  535.         o  file name is movement
  536.     
  537.         o  practice moving around file 
  538.  
  539.         o  Use ESC :q! to exit
  540.  
  541.         o  Take a break!!!!
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  #####                                                           #####
  551. #     #  #    #    ##    #####    #####  ######  #####          #     #
  552. #        #    #   #  #   #    #     #    #       #    #               #
  553. #        ######  #    #  #    #     #    #####   #    #          #####
  554. #        #    #  ######  #####      #    #       #####                #
  555. #     #  #    #  #    #  #          #    #       #   #          #     #
  556.  #####   #    #  #    #  #          #    ######  #    #          #####
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.   ###
  568.    #     #    #   ####   ######  #####    #####     #    #    #   ####
  569.    #     ##   #  #       #       #    #     #       #    ##   #  #    #
  570.    #     # #  #   ####   #####   #    #     #       #    # #  #  #
  571.    #     #  # #       #  #       #####      #       #    #  # #  #  ###
  572.    #     #   ##  #    #  #       #   #      #       #    #   ##  #    #
  573.   ###    #    #   ####   ######  #    #     #       #    #    #   ####
  574.  
  575. #######
  576.    #     ######  #    #   #####
  577.    #     #        #  #      #
  578.    #     #####     ##       #
  579.    #     #         ##       #
  580.    #     #        #  #      #
  581.    #     ######  #    #     #
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.             Inserting Text
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.         o  Will be in Insert mode.
  603.  
  604.         o  Escape will get you out.
  605.  
  606.             o ESC ZZ -  write file and leave vi.
  607.  
  608.             o ESC :wq - write file and leave vi.
  609.  
  610.             o ESC -  Placed back into command mode.
  611.  
  612.         o  Cursor is key element.
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.             Inserting Text
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.         o  Insert Commands
  633.  
  634.             o  i - insert before cursor
  635.  
  636.             o  I - insert at beginning of line
  637.  
  638.  
  639.         o  Append Commands
  640.  
  641.             o  a - appends after cursor
  642.  
  643.             o  A - appends at end of line
  644.  
  645.  
  646.         o  Either way in Insert Mode
  647.  
  648.         o  Numeric count can be added before these commands
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.             Inserting Text
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.         o  Open a line
  670.  
  671.             o  O  - Open a line above cursor
  672.  
  673.             o  o  - Open a line below cursor
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.             Misc. Commands
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.         o  ^V - insert control characters
  698.  
  699.         o  .  - Do it Again
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.             Summary Text
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.             o  a - appends after cursor
  722.             o  i - insert before cursor
  723.             o  o - Open a line below cursor
  724.  
  725.             o  A - appends at end of line
  726.             o  I - insert at beginning of line
  727.             o  O - Open a line above cursor
  728.  
  729.             o CTRL-V - insert control characters
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  #####                                                          #
  739. #     #  #    #    ##    #####    #####  ######  #####          #    #
  740. #        #    #   #  #   #    #     #    #       #    #         #    #
  741. #        ######  #    #  #    #     #    #####   #    #         #    #
  742. #        #    #  ######  #####      #    #       #####          #######
  743. #     #  #    #  #    #  #          #    #       #   #               #
  744.  #####   #    #  #    #  #          #    ######  #    #              #
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754. ######                                                                #
  755. #     #  ######  #       ######   #####     #    #    #   ####       #
  756. #     #  #       #       #          #       #    ##   #  #    #     #
  757. #     #  #####   #       #####      #       #    # #  #  #         #
  758. #     #  #       #       #          #       #    #  # #  #  ###   #
  759. #     #  #       #       #          #       #    #   ##  #    #  #
  760. ######   ######  ######  ######     #       #    #    #   ####  #
  761.  
  762.  #####
  763. #     #  #    #    ##    #    #   ####      #    #    #   ####
  764. #        #    #   #  #   ##   #  #    #     #    ##   #  #    #
  765. #        ######  #    #  # #  #  #          #    # #  #  #
  766. #        #    #  ######  #  # #  #  ###     #    #  # #  #  ###
  767. #     #  #    #  #    #  #   ##  #    #     #    #   ##  #    #
  768.  #####   #    #  #    #  #    #   ####      #    #    #   ####
  769.  
  770.                 #######
  771.                    #     ######  #    #   #####
  772.                    #     #        #  #      #
  773.                    #     #####     ##       #
  774.                    #     #         ##       #
  775.                    #     #        #  #      #
  776.                    #     ######  #    #     #
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.             Deleting Text
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.         o  Deleting text is either done a character, word,
  799.  
  800.         line, or region at a time.  By placing a number
  801.  
  802.         in front of the delete expression the action can be 
  803.  
  804.         done many times.
  805.  
  806.  
  807.         o  Deleting an expression will put it in a buffer.
  808.  
  809.         The put command will place a copy of it after 
  810.  
  811.         the cursor.
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.             Deleting Text
  822.             Main Delete Commands
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.         o  x - delete current character     ***
  834.  
  835.         o  dw - delete word                ***
  836.  
  837.         o  d$ - delete to end of line
  838.         o  D  - delete to end of line
  839.  
  840.         o  dd - delete whole line        ***
  841.  
  842.  
  843.  
  844.         *** numeric count can be added before command
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.             Deleting Text
  854.             cursor characters
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.         o  d(CR) - delete whole line
  866.         o  d^ - delete from beginning of line to cursor
  867.  
  868.         o  db - delete previous word        ***
  869.         o  dB - delete previous long word    ***
  870.  
  871.         o  de - delete to end of word
  872.         o  dE - delete to end of long word
  873.  
  874.         o  dW - delete long word        ***
  875.  
  876.         o  dH - delete from beginning of window to cursor line
  877.         o  dM - delete from curor line to middle of screen
  878.         o  dL - delete from cursor to end of window
  879.  
  880.  
  881.  
  882.         *** numeric count can be added before command
  883.     
  884.         These are not normally used except by expert users.
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.             Changing Text
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.         o  r - Replace one character.
  906.  
  907.         o  R - Overwrite text in insert mode.
  908.  
  909.         o  ~ - Change case
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.             Changing Text
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.         o  Changing text is either done a character, word,
  932.  
  933.         line, or region at a time.  By placing a number
  934.  
  935.         in front of the change expression, the action can be 
  936.  
  937.         done many times.
  938.  
  939.  
  940.  
  941.         o  In changing more than a word, vi deletes
  942.  
  943.                 the expression, and enters into insert mode at 
  944.  
  945.         the beginning of the expression.
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.             Changing Text
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.         o  cw - change word            ***
  968.  
  969.         o  c$ - change to end of line
  970.  
  971.         o  C  - change to end of line
  972.  
  973.         *** Numeric count can be added before command
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.             Changing Text
  985.             cursor characters
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.         o  c(CR) - change whole line
  997.         o  c^ - change from beginning of line to cursor
  998.  
  999.         o  cb - change previous word        ***
  1000.         o  cB - change previous long word    ***
  1001.  
  1002.         o  ce - change to end of word
  1003.         o  cE - change to end of word
  1004.  
  1005.         o  cW - change long word        ***
  1006.  
  1007.         o  cH - change from beginning of window to cursor line
  1008.         o  cM - change from curor line to middle of screen
  1009.         o  cL - change from cursor to end of window
  1010.  
  1011.  
  1012.  
  1013.         *** numeric count can be added before command
  1014.         These are not normally used except by expert users.
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.             Undoing Stuff
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.         o  u - undo last change
  1037.  
  1038.         o  U - undo all changes to last line
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.                 Summary 
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.             o  c - changes text
  1062.             o  d - deletes text
  1063.             o  r - replaces a character
  1064.             o  u - undoes last change
  1065.  
  1066.             o  C - changes to end of line
  1067.             o  D - deletes to end of line
  1068.             o  R - overwrites text
  1069.             o  U - undoes all changes to line
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  #####                                                          #######
  1080. #     #  #    #    ##    #####    #####  ######  #####          #
  1081. #        #    #   #  #   #    #     #    #       #    #         #
  1082. #        ######  #    #  #    #     #    #####   #    #         ######
  1083. #        #    #  ######  #####      #    #       #####                #
  1084. #     #  #    #  #    #  #          #    #       #   #          #     #
  1085.  #####   #    #  #    #  #          #    ######  #    #          #####
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097. #######
  1098. #     #   #####  #    #  ######  #####
  1099. #     #     #    #    #  #       #    #
  1100. #     #     #    ######  #####   #    #
  1101. #     #     #    #    #  #       #####
  1102. #     #     #    #    #  #       #   #
  1103. #######     #    #    #  ######  #    #
  1104.  
  1105. #######
  1106. #        #    #  #    #   ####    #####     #     ####   #    #   ####
  1107. #        #    #  ##   #  #    #     #       #    #    #  ##   #  #
  1108. #####    #    #  # #  #  #          #       #    #    #  # #  #   ####
  1109. #        #    #  #  # #  #          #       #    #    #  #  # #       #
  1110. #        #    #  #   ##  #    #     #       #    #    #  #   ##  #    #
  1111. #         ####   #    #   ####      #       #     ####   #    #   ####
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.             Searching
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.         o  /string  -  moves cursor to occurence of string
  1134.         pattern.
  1135.  
  1136.         o  ?string  -  searches backward through the buffer
  1137.         for string pattern.
  1138.  
  1139.         o  n -  finds next occurence of the string pattern.
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.             Regular Expressions
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.         A Regular Expression is used to specify parts of a
  1157.     line.  It is used in search, substitute, and delete commands.  The
  1158.     concept is also used in many other UNIX commands, to include grep,
  1159.     sed, and jove.
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.         o  ^ - beginning of line.
  1166.  
  1167.         o  $ - end of line.
  1168.  
  1169.         o  . - matches any character.
  1170.  
  1171.         o  \ - delimits special characters.
  1172.  
  1173.         o [] - range of characters.
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.             Yanking
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.         o  yw -  yank word
  1196.  
  1197.         o  y$ -  yank to end of line
  1198.  
  1199.         o  yy -  yank line
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.             Yanking
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.         o  y(CR) - yank whole line
  1223.         o  y^ - yank from beginning of line to cursor
  1224.  
  1225.         o  yb - yank previous word        ***
  1226.         o  yB - yank previous long word        ***
  1227.  
  1228.         o  ye - yank to end of word
  1229.         o  yE - yank to end of long word
  1230.  
  1231.         o  yW - yank long word            ***
  1232.  
  1233.         o  yH - yank from beginning of window to cursor line
  1234.         o  yM - yank from curor line to middle of screen
  1235.         o  yL - yank from cursor to end of window
  1236.  
  1237.  
  1238.  
  1239.         *** numeric count can be added before command
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.             Putting Text
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.         o  puts last text object
  1263.  
  1264.         o  p - puts on next line or next character
  1265.  
  1266.         o  P - put on previous line or previous character
  1267.  
  1268.         o  xp - transposes character
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.             Screen Adjusting
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.         o  CTRL-L -  refresh screen.
  1293.  
  1294.         o  CTRL-E -  Scroll window down 1 line.
  1295.  
  1296.         o  CTRL-Y -  Scroll window up 1 line.
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.             Misc.
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.         o   J - Joins lines.  The line(s) below the cursor
  1322.             will be appended to the current line.  "2J" is equal
  1323.         to "J". "3J" will join the two line below the
  1324.         current line with the current line.
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.                 Summary 
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.             o  p - put text after cursor or line.
  1349.             o  y - yank text.
  1350.  
  1351.             o  J - join next line with cursor line.
  1352.             o  P - put text before cursor or line.
  1353.             o  Y - yank to end of line
  1354.  
  1355.             o  CTRL-E -  scroll window down 1 line.
  1356.             o  CTRL-Y -  scroll window up 1 line.
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  #####                                                           #####
  1366. #     #  #    #    ##    #####    #####  ######  #####          #     #
  1367. #        #    #   #  #   #    #     #    #       #    #         #
  1368. #        ######  #    #  #    #     #    #####   #    #         ######
  1369. #        #    #  ######  #####      #    #       #####          #     #
  1370. #     #  #    #  #    #  #          #    #       #   #          #     #
  1371.  #####   #    #  #    #  #          #    ######  #    #          #####
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383. ####### #     #
  1384. #        #   #
  1385. #         # #
  1386. #####      #
  1387. #         # #
  1388. #        #   #
  1389. ####### #     #
  1390.  
  1391. #     #
  1392. ##   ##   ####   #####   ######
  1393. # # # #  #    #  #    #  #
  1394. #  #  #  #    #  #    #  #####
  1395. #     #  #    #  #    #  #
  1396. #     #  #    #  #    #  #
  1397. #     #   ####   #####   ######
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.             Writing
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.         o  :w  - basic form of write command
  1421.  
  1422.         o  :y,xw filename
  1423.  
  1424.         o  :y,xw! filename
  1425.  
  1426.         o  :y,xw! !program
  1427.  
  1428.           y refers to the yth line of the file, x to the xth
  1429.         line of the file.  If the file already exists the !
  1430.         right after the w tells vi to overwrite the file.  filename
  1431.         refers to any file while !program means to write the
  1432.         file to the input of the program.
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.             Reading
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.         o  :r file  - will read file into the buffer
  1456.                 after the cursor.
  1457.  
  1458.         o  :xr file - will read file into the buffer
  1459.             after line x.
  1460.  
  1461.         o  :r !program - will read into the buffer after the
  1462.         cursor the output of executing program.
  1463.  
  1464.         o  :xr !program - will read into the buffer after
  1465.         line x the output of executing program.
  1466.  
  1467.         o  :x,y! program - will replace lines x through y
  1468.         with the output of executing program with input 
  1469.                 of lines x through y.
  1470.  
  1471.         o  :x,y! fmt - reformat these lines.
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.             Quit & File Commands
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.         o  :x  - write and quit the vi buffer.
  1497.         o  :wq - write and quit the vi buffer.
  1498.  
  1499.         o  :q  - quit vi.  Will not allow you to quit
  1500.         if any changes have been made to buffer.
  1501.  
  1502.         o  :q! - quit vi regardless of wheter any changes 
  1503.         have made made.
  1504.  
  1505.         o  :f  - print the name of the file & line number
  1506.         where cursor is located.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.         Editing Multiple Files
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.     
  1526.             o vi file1 file2 file3
  1527.  
  1528.             o :n - will allow you to edit next file
  1529.  
  1530.             o :e  file 
  1531.             o :e! file  - change file to file
  1532.             o :e! %     - start over
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.             Deletion
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.         o  :1d    - deletes first line of file.
  1558.  
  1559.         o  :1,$d - deletes all lines from file.
  1560.  
  1561.         o  :1,5d - deletes lines 1 through 5 of file.
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.             Substitution
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.         o  :xs/RE/re/
  1587.         o  :xs/RE/re/g   - On line x substitute "re" for 
  1588.         "RE".  The g means do it for all lines.
  1589.  
  1590.         o  :1,$s/RE/re/g 
  1591.  
  1592.         As you can see, you can specify a line, lines, or the
  1593.         whole file to change.  Use the g option to make
  1594.         changes throughout the line rather than just the
  1595.         first occurence of a change in the line.
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.             Shell Escapes
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.         o  :sh
  1620.  
  1621.         o  :!sh
  1622.  
  1623.         o  :1,5!fmt
  1624.  
  1625.         Both ":sh" and ":!sh" will let you escape to the
  1626.         command processor.  When the shell is exited, control
  1627.         passes back to vi.  The form ":1,5!program" will
  1628.         execute a program with lines 1 through 5 being used as
  1629.         the standard input for the program.  The output of the
  1630.         program will replace lines 1 through 5 in the file.
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.             Global Substitions
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.         o  :g/RE/p  - global search and print.
  1657.  
  1658.         o  :g/RE/d  - will delete any line with RE in it.
  1659.  
  1660.         o  :g/RE/s//re will substitute re for RE globally
  1661.         through out the file.
  1662.  
  1663.         o  :g/RE/s/AB/CD/ - will substitute CD for AB
  1664.         wherever RE exists on a line.
  1665.  
  1666.  
  1667.         o  The p option will print to the terminal all lines
  1668.                 where the action was completed.
  1669.  
  1670.         o  v instead of g will do it for all ines that don't
  1671.         match.
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.             set
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.         o  :set all  - list all parameters
  1699.  
  1700.         o  :set nu
  1701.         o  :set nonu -  Turns on/off numbering for lines
  1702.            in file.
  1703.  
  1704.         o  :set list
  1705.         o  :set nolist - Turns on/off substituting "^I" for
  1706.         the tab character and $ for the (CR).
  1707.  
  1708.         o  :set wm=x  - sets the wrap margin.  If wm is set to
  1709.         0, cursor will not wrap around.  Cursor will wrap x
  1710.         spaces from right margin.
  1711.  
  1712.         o  all these parameters can go into a file called
  1713.         .exrc which will do this for all invocations of vi.
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.             map & ab
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.         o  ab chnage change - will change all occurrences of
  1741.         chnage with change when separated by whitespace when
  1742.         input in insert mode.
  1743.  
  1744.         o  map f :f   -  whenever f is hit in command mode
  1745.         will do :f instead of f.  Useful to define
  1746.         cursor keys.
  1747.  
  1748.         o  These can also be put into .exrc file.
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758. ####### #     #    #    #       #     #    #    #######   ###   ####### #     #
  1759. #       #     #   # #   #       #     #   # #      #       #    #     # ##    #
  1760. #       #     #  #   #  #       #     #  #   #     #       #    #     # # #   #
  1761. #####   #     # #     # #       #     # #     #    #       #    #     # #  #  #
  1762. #        #   #  ####### #       #     # #######    #       #    #     # #   # #
  1763. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  1764. #######    #    #     # #######  #####  #     #    #      ###   ####### #     #
  1765.  
  1766.  
  1767. 1)  What were your goals in taking this course?
  1768.  
  1769. ----------------------------------------------------------------------
  1770.  
  1771.  
  1772. 2)  Did you learn anything in this course?  
  1773.  
  1774. ----------------------------------------------------------------------
  1775.  
  1776. 3)  What did you think of the course notes?
  1777.  
  1778. ----------------------------------------------------------------------
  1779.  
  1780. ----------------------------------------------------------------------
  1781.  
  1782. ----------------------------------------------------------------------
  1783.  
  1784. 4)  Did you like the course?
  1785.  
  1786. ----------------------------------------------------------------------
  1787.  
  1788. ----------------------------------------------------------------------
  1789.  
  1790. 5)  What did you think of the instructor?
  1791.  
  1792. ----------------------------------------------------------------------
  1793.  
  1794. ----------------------------------------------------------------------
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.             Summary Of VI Commands
  1802.         
  1803.                         o  a  - appends after cursor
  1804.                         o  b  - back up a word
  1805.                         o  c  - changes text
  1806.                         o  d  - deletes text
  1807.                         o  e  - forward to end of word
  1808.                         o  h  - 1 space back
  1809.                         o  i  - insert before cursor
  1810.                         o  j  - 1 space down
  1811.                         o  k  - 1 space up
  1812.                         o  l  - 1 space forward
  1813.                         o  o  - Open a line below cursor
  1814.                         o  p  - put text after cursor or line
  1815.                         o  r  - replaces a character
  1816.                         o  u  - undoes last change
  1817.                         o  w  - forward to next word
  1818.                         o  y  - yank text
  1819.  
  1820.  
  1821.                         o  A  - appends at end of line
  1822.                         o  B  - back up a word
  1823.                         o  C  - changes to end of line
  1824.                         o  D  - deletes to end of line
  1825.                         o  E  - forward to end of word
  1826.                         o  G  - last line of file
  1827.                         o  H  - Home or 1st Line
  1828.                         o  I  - insert at beginning of line
  1829.                         o  L  - Last Line
  1830.                         o  J -  join next line with cursor line
  1831.                         o  P -  put text before cursor or line
  1832.                         o  M  - Middle Line
  1833.                         o  O  - Open a line above cursor
  1834.                         o  R  - overwrites text
  1835.                         o  U  - undoes all changes to line
  1836.                         o  W  - forward to next word
  1837.                         o  Y -  yank to end of line
  1838.  
  1839.                         o  CTRL-B - Back a screen
  1840.                         o  CTRL-D - Forward 1/2 screen
  1841.                         o  CTRL-E - scroll window down 1 line
  1842.                         o  CTRL-F - Forward a screen
  1843.                         o  CTRL-G - Displays current info
  1844.                         o  CTRL-U - Back 1/2 screen
  1845.                         o  CTRL-V - insert control characters
  1846.                         o  CTRL-Y - scroll window up 1 line
  1847.  
  1848.  
  1849.                                                       #####
  1850. #     #  #    #    ##    #####    #####  ######  #####          #     #
  1851. #        #    #   #  #   #    #     #    #       #    #         #
  1852. #        ######  #    #  #    #     #    #####   #    #         ######
  1853. #        #    #  ######  #####      #    #       #####          #     #
  1854. #     #  #    # vi/makevi   755   1552     12         444  4452706266   5742 #!/bin/sh
  1855. #
  1856. #      this will compile all lessons and put into file called course
  1857. #
  1858.  
  1859.  
  1860. if test -f vi
  1861.      then mv vi vi.old
  1862. fi
  1863.     
  1864. DIR="head 1 2 3 4 5 6 "
  1865. for name in ${DIR}
  1866. do
  1867.     cd ${name}
  1868.     cat ${name}.* > ${name}
  1869.     cat ${name} >> ../vi
  1870.     rm ${name}
  1871.     cd ..
  1872. done
  1873.  
  1874. cp vi ../vi.txt            # put at top level
  1875.                  o  h  - 1 space back
  1876.                         o  i  - insert before cursor
  1877.                         o  j  - 1 space down
  1878.                         o  k  - 1 space up
  1879.                         o  l  - 1 space fvi/vi.old   644   1552     12       62276  4551160727   5725 
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.         #     #   ###
  1888.         #     #    #
  1889.         #     #    #
  1890.         #     #    #
  1891.          #   #     #
  1892.           # #      #
  1893.            #      ###
  1894.         
  1895.     
  1896.     
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.           ####    ####   #    #  #####    ####   ######
  1907.          #    #  #    #  #    #  #    #  #       #
  1908.          #       #    #  #    #  #    #   ####   #####
  1909.          #       #    #  #    #  #####        #  #
  1910.          #    #  #    #  #    #  #   #   #    #  #
  1911.           ####    ####    ####   #    #   ####   ######
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.         Developed by Analytical Evaluation Branch, FSAC
  1918.         Revision 2.1    13 Nov 1989
  1919.         Author:        Dennis G. Rears
  1920.         EMail Address:    <drears@pica.army.mil>
  1921.         Phone:        (201) 724-2683
  1922.         UPS:        Box 210, Wharton, NJ  07885
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.             VI Course
  1931.  
  1932.  
  1933.         Revision History
  1934.  
  1935.     2.1    13 Nov 1989   Dennis Rears   <drears>
  1936.  
  1937.         Minor corrections.
  1938.  
  1939.     2.0    27 June 1989  Dennis Rears   <drears>
  1940.                   Robert Webster <bwebster>
  1941.  
  1942.            Changed representation of control characters to CTRL.
  1943.            Expanded EX section.
  1944.     
  1945.  
  1946.  
  1947.     1.1    21 Mar 1989  Dennis Rears
  1948.  
  1949.            Rewrote course, greatly expanding "outline".
  1950.  
  1951.  
  1952.     1.0     Circa 1988  Dennis Rears
  1953.  
  1954.         Original Course.
  1955.  
  1956.  
  1957.  
  1958.  
  1959.         Developed by Analytical Evaluation Branch, FSAC
  1960.         Host:        caesar.pica.army.mil
  1961.         Location:    /u1/drears/teach/vi/course
  1962.         Author:        Dennis G. Rears
  1963.         EMail Address:    <drears@pica.army.mil>
  1964.         Phone:        (201) 724-2683
  1965.         Date:          27 June 1989
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.             VI Course
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.         Table of Contents
  1988.  
  1989.  
  1990.         1) Introduction
  1991.  
  1992.         2) Navigation
  1993.  
  1994.         3) Inserting Text
  1995.  
  1996.         4) Deleting/Changing Text
  1997.  
  1998.         5) Other Functions
  1999.  
  2000.            6) Ex Mode
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.   ####   #    #    ##    #####    #####  ######  #####            ##
  2009.  #    #  #    #   #  #   #    #     #    #       #    #          # #
  2010.  #       ######  #    #  #    #     #    #####   #    #            #
  2011.  #       #    #  ######  #####      #    #       #####             #
  2012.  #    #  #    #  #    #  #          #    #       #   #             #
  2013.   ####   #    #  #    #  #          #    ######  #    #          #####
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.     #    #    #   #####  #####    ####
  2023.     #    ##   #     #    #    #  #    #
  2024.     #    # #  #     #    #    #  #    #
  2025.     #    #  # #     #    #####   #    #
  2026.     #    #   ##     #    #   #   #    #
  2027.     #    #    #     #    #    #   ####
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.             INTRODUCTION
  2037.  
  2038.  
  2039.  
  2040.         o Ed Family of Editors
  2041.  
  2042.             o e
  2043.             o edit
  2044.             o ex
  2045.             o view
  2046.             o vi
  2047.  
  2048.  
  2049.         o Full Screen Editor
  2050.  
  2051.             o Terminal Type
  2052.  
  2053.  
  2054.         o Developed by UC at Berkeley
  2055.             
  2056.             o Bill Joy
  2057.             o Mike Horton
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.             
  2068.             Important Terms
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.     
  2075.     o VI - VIsual Editor, a full screen editor used by all UNIX
  2076.         systems.
  2077.  
  2078.     o shell - The command processor.
  2079.  
  2080.     o shell escape - An action that allows the user to issue a
  2081.     shell command from a running program. 
  2082.  
  2083.     o buffer - A temporary place to store info.
  2084.  
  2085.     o file - A permament place to store data.
  2086.  
  2087.     o unix - The operating system in use on ARDEC workplace
  2088.         automation machines.
  2089.  
  2090.     o Control Character - A character represented by "CTRL X".
  2091.     To make the character the Control and letter key must be
  2092.     hit at the same time.
  2093.  
  2094.     o White Space - A tab, space, or new line character.
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.             Modes
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.          VI works in three different modes. They are:
  2112.  
  2113.  
  2114.             o  Insert Mode -  This mode is used when
  2115.         appending, inserting, changing, and replacing text. 
  2116.  
  2117.             o  Ex Mode -  This mode allows for use of 
  2118.         the ex set of commands.  This mode can act on one line
  2119.         at a time, several lines at a time, or every line.
  2120.         Shell escapes are executed at this level.
  2121.  
  2122.             o  Command Mode - Vi begins in this mode.
  2123.         This mode allows you to switch to the other modes.  
  2124.         In addition, deleting, transposing, yanking, and 
  2125.         other functions are performed here.
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.             IMPORTANT KEYS
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.         o  ESCAPE - Exits insert mode.
  2145.  
  2146.         o  COLON - Enters ex mode.
  2147.  
  2148.         o  BANG (!) - shell escape.
  2149.  
  2150.         o  TILDE (~) - no line is present as opposed
  2151.                    to nothing on the line. 
  2152.  
  2153.         o  CTRL L - screen refresh or form feed.
  2154.  
  2155.  
  2156.            CTRL L indicates that the "L" key and the
  2157.         Control key are depressed at the same time.
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  #####                                                           #####
  2166. #     #  #    #    ##    #####    #####  ######  #####          #     #
  2167. #        #    #   #  #   #    #     #    #       #    #               #
  2168. #        ######  #    #  #    #     #    #####   #    #          #####
  2169. #        #    #  ######  #####      #    #       #####          #
  2170. #     #  #    #  #    #  #          #    #       #   #          #
  2171.  #####   #    #  #    #  #          #    ######  #    #         #######
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181. #     #
  2182. ##    #    ##    #    #     #     ####     ##     #####     #     ####   #    #
  2183. # #   #   #  #   #    #     #    #    #   #  #      #       #    #    #  ##   #
  2184. #  #  #  #    #  #    #     #    #       #    #     #       #    #    #  # #  #
  2185. #   # #  ######  #    #     #    #  ###  ######     #       #    #    #  #  # #
  2186. #    ##  #    #   #  #      #    #    #  #    #     #       #    #    #  #   ##
  2187. #     #  #    #    ##       #     ####   #    #     #       #     ####   #    #
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.             What is a line?
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.         o  Physical Line -  the maximum characters
  2208.         your screen can hold in a line.
  2209.  
  2210.         o  Logical Line  -  A line terminated by the <CR> 
  2211.         character.
  2212.  
  2213.         o  At most, one logical line can fit into one
  2214.         physical line but physical line can fit into 
  2215.         a logical line.
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.              Navigation
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.         o  VI lets you move the cursor a character, word,
  2234.                  line, or region at a time.
  2235.  
  2236.         o  As with other functions keys, a numeric count can
  2237.            be added before the key to repeat the function.
  2238.  
  2239.         o  Example:
  2240.  
  2241.             o h will move the cursor back 1 character
  2242.  
  2243.             o 4h will move the cursor back 4 characters
  2244.  
  2245.         o  VI will not let you navigate before the beginning
  2246.         or end of the file.
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.             Navigation
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.         o  cursor keys
  2264.  
  2265.         o  home keys
  2266.  
  2267.             o h  -  1 space back        ***
  2268.             o j  -  1 space down        ***
  2269.             o k  -  1 space up        ***
  2270.             o l  -  1 space forward        ***
  2271.  
  2272.         o  screen keys
  2273.  
  2274.             o H -  Home or 1st Line
  2275.             o M -  Middle Line
  2276.             o L -  Last Line
  2277.  
  2278.         o control keys
  2279.  
  2280.             o CTRL-B - back a screen
  2281.             o CTRL-F - forward a screen
  2282.             o CTRL-U - Up half a screen
  2283.             o CTRL-D - Down half a screen
  2284.  
  2285.  
  2286.         *** a numeric count can be added before the command.
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.             Navigation Within A Line
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.         o  Word Navigation (not including punctuation)
  2305.  
  2306.             o  b - back up a word
  2307.  
  2308.             o  e - forward to end of word
  2309.  
  2310.             o  w - forward to next word
  2311.  
  2312.  
  2313.         o Bigger Word (includes punctuation)
  2314.  
  2315.  
  2316.             o  B - back up a word
  2317.  
  2318.             o  E - forward to end of word
  2319.  
  2320.             o  W - forward to next word
  2321.  
  2322.         o Numeric count can be added before all of these commands
  2323.           
  2324.             o e.g. 5e - forward to end of fifth word.
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.             Navigating
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.         o  0  - First character of file.
  2344.  
  2345.         o  ^  - First non-whitespace character.
  2346.  
  2347.         o  $  - End of line.
  2348.  
  2349.         o  xG - line x of the file.
  2350.  
  2351.         o  G  - Last line of file.
  2352.  
  2353.         o  CTRL-G - Displays current info
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.                   Summary
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.             o  b  - back up a word
  2376.             o  e  - forward to end of word
  2377.             o  h  -  1 space back
  2378.             o  j  -  1 space down
  2379.             o  k  -  1 space up
  2380.             o  l  -  1 space forward
  2381.             o  w  - forward to next word
  2382.  
  2383.             o  B  - back up a word
  2384.             o  E  - forward to end of word
  2385.                 o  G  - last line of file
  2386.             o  H  -  Home or 1st Line
  2387.             o  L  -  Last Line
  2388.             o  M  -  Middle Line
  2389.             o  W  - forward to next word
  2390.  
  2391.             o  CTRL-B - Back a screen
  2392.             o  CTRL-D - Forward 1/2 screen
  2393.             o  CTRL-F - Forward a screen
  2394.             o  CTRL-G - Displays current info
  2395.             o  CTRL-U - Back 1/2 screen
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.             Navigating.
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.         Exercise #1  
  2417.  
  2418.         o  Use view instead of vi
  2419.  
  2420.         o  file name is movement
  2421.     
  2422.         o  practice moving around file 
  2423.  
  2424.         o  Use ESC :q! to exit
  2425.  
  2426.         o  Take a break!!!!
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  #####                                                           #####
  2436. #     #  #    #    ##    #####    #####  ######  #####          #     #
  2437. #        #    #   #  #   #    #     #    #       #    #               #
  2438. #        ######  #    #  #    #     #    #####   #    #          #####
  2439. #        #    #  ######  #####      #    #       #####                #
  2440. #     #  #    #  #    #  #          #    #       #   #          #     #
  2441.  #####   #    #  #    #  #          #    ######  #    #          #####
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.   ###
  2453.    #     #    #   ####   ######  #####    #####     #    #    #   ####
  2454.    #     ##   #  #       #       #    #     #       #    ##   #  #    #
  2455.    #     # #  #   ####   #####   #    #     #       #    # #  #  #
  2456.    #     #  # #       #  #       #####      #       #    #  # #  #  ###
  2457.    #     #   ##  #    #  #       #   #      #       #    #   ##  #    #
  2458.   ###    #    #   ####   ######  #    #     #       #    #    #   ####
  2459.  
  2460. #######
  2461.    #     ######  #    #   #####
  2462.    #     #        #  #      #
  2463.    #     #####     ##       #
  2464.    #     #         ##       #
  2465.    #     #        #  #      #
  2466.    #     ######  #    #     #
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.             Inserting Text
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.         o  Will be in Insert mode.
  2488.  
  2489.         o  Escape will get you out.
  2490.  
  2491.             o ESC ZZ -  write file and leave vi.
  2492.  
  2493.             o ESC :wq - write file and leave vi.
  2494.  
  2495.             o ESC -  Placed back into command mode.
  2496.  
  2497.         o  Cursor is key element.
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.             Inserting Text
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.         o  Insert Commands
  2518.  
  2519.             o  i - insert before cursor
  2520.  
  2521.             o  I - insert at beginning of line
  2522.  
  2523.  
  2524.         o  Append Commands
  2525.  
  2526.             o  a - appends after cursor
  2527.  
  2528.             o  A - appends at end of line
  2529.  
  2530.  
  2531.         o  Either way in Insert Mode
  2532.  
  2533.         o  Numeric count can be added before these commands
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.             Inserting Text
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.         o  Open a line
  2555.  
  2556.             o  O  - Open a line above cursor
  2557.  
  2558.             o  o  - Open a line below cursor
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.             Misc. Commands
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.         o  ^V - insert control characters
  2583.  
  2584.         o  .  - Do it Again
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.             Summary Text
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.             o  a - appends after cursor
  2607.             o  i - insert before cursor
  2608.             o  o - Open a line below cursor
  2609.  
  2610.             o  A - appends at end of line
  2611.             o  I - insert at beginning of line
  2612.             o  O - Open a line above cursor
  2613.  
  2614.             o CTRL-V - insert control characters
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  #####                                                          #
  2624. #     #  #    #    ##    #####    #####  ######  #####          #    #
  2625. #        #    #   #  #   #    #     #    #       #    #         #    #
  2626. #        ######  #    #  #    #     #    #####   #    #         #    #
  2627. #        #    #  ######  #####      #    #       #####          #######
  2628. #     #  #    #  #    #  #          #    #       #   #               #
  2629.  #####   #    #  #    #  #          #    ######  #    #              #
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639. ######                                                                #
  2640. #     #  ######  #       ######   #####     #    #    #   ####       #
  2641. #     #  #       #       #          #       #    ##   #  #    #     #
  2642. #     #  #####   #       #####      #       #    # #  #  #         #
  2643. #     #  #       #       #          #       #    #  # #  #  ###   #
  2644. #     #  #       #       #          #       #    #   ##  #    #  #
  2645. ######   ######  ######  ######     #       #    #    #   ####  #
  2646.  
  2647.  #####
  2648. #     #  #    #    ##    #    #   ####      #    #    #   ####
  2649. #        #    #   #  #   ##   #  #    #     #    ##   #  #    #
  2650. #        ######  #    #  # #  #  #          #    # #  #  #
  2651. #        #    #  ######  #  # #  #  ###     #    #  # #  #  ###
  2652. #     #  #    #  #    #  #   ##  #    #     #    #   ##  #    #
  2653.  #####   #    #  #    #  #    #   ####      #    #    #   ####
  2654.  
  2655.                 #######
  2656.                    #     ######  #    #   #####
  2657.                    #     #        #  #      #
  2658.                    #     #####     ##       #
  2659.                    #     #         ##       #
  2660.                    #     #        #  #      #
  2661.                    #     ######  #    #     #
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.             Deleting Text
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.         o  Deleting text is either done a character, word,
  2684.  
  2685.         line, or region at a time.  By placing a number
  2686.  
  2687.         in front of the delete expression the action can be 
  2688.  
  2689.         done many times.
  2690.  
  2691.  
  2692.         o  Deleting an expression will put it in a buffer.
  2693.  
  2694.         The put command will place a copy of it after 
  2695.  
  2696.         the cursor.
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.             Deleting Text
  2707.             Main Delete Commands
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.         o  x - delete current character     ***
  2719.  
  2720.         o  dw - delete word                ***
  2721.  
  2722.         o  d$ - delete to end of line
  2723.         o  D  - delete to end of line
  2724.  
  2725.         o  dd - delete whole line        ***
  2726.  
  2727.  
  2728.  
  2729.         *** numeric count can be added before command
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.             Deleting Text
  2739.             cursor characters
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.         o  d(CR) - delete whole line
  2751.         o  d^ - delete from beginning of line to cursor
  2752.  
  2753.         o  db - delete previous word        ***
  2754.         o  dB - delete previous long word    ***
  2755.  
  2756.         o  de - delete to end of word
  2757.         o  dE - delete to end of long word
  2758.  
  2759.         o  dW - delete long word        ***
  2760.  
  2761.         o  dH - delete from beginning of window to cursor line
  2762.         o  dM - delete from curor line to middle of screen
  2763.         o  dL - delete from cursor to end of window
  2764.  
  2765.  
  2766.  
  2767.         *** numeric count can be added before command
  2768.     
  2769.         These are not normally used except by expert users.
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.             Changing Text
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.         o  r - Replace one character.
  2791.  
  2792.         o  R - Overwrite text in insert mode.
  2793.  
  2794.         o  ~ - Change case
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.             Changing Text
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.         o  Changing text is either done a character, word,
  2817.  
  2818.         line, or region at a time.  By placing a number
  2819.  
  2820.         in front of the change expression, the action can be 
  2821.  
  2822.         done many times.
  2823.  
  2824.  
  2825.  
  2826.         o  In changing more than a word, vi deletes
  2827.  
  2828.                 the expression, and enters into insert mode at 
  2829.  
  2830.         the beginning of the expression.
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.             Changing Text
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.         o  cw - change word            ***
  2853.  
  2854.         o  c$ - change to end of line
  2855.  
  2856.         o  C  - change to end of line
  2857.  
  2858.         *** Numeric count can be added before command
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.             Changing Text
  2870.             cursor characters
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.         o  c(CR) - change whole line
  2882.         o  c^ - change from beginning of line to cursor
  2883.  
  2884.         o  cb - change previous word        ***
  2885.         o  cB - change previous long word    ***
  2886.  
  2887.         o  ce - change to end of word
  2888.         o  cE - change to end of word
  2889.  
  2890.         o  cW - change long word        ***
  2891.  
  2892.         o  cH - change from beginning of window to cursor line
  2893.         o  cM - change from curor line to middle of screen
  2894.         o  cL - change from cursor to end of window
  2895.  
  2896.  
  2897.  
  2898.         *** numeric count can be added before command
  2899.         These are not normally used except by expert users.
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.             Undoing Stuff
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.         o  u - undo last change
  2922.  
  2923.         o  U - undo all changes to last line
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.                 Summary 
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.             o  c - changes text
  2947.             o  d - deletes text
  2948.             o  r - replaces a character
  2949.             o  u - undoes last change
  2950.  
  2951.             o  C - changes to end of line
  2952.             o  D - deletes to end of line
  2953.             o  R - overwrites text
  2954.             o  U - undoes all changes to line
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  #####                                                          #######
  2965. #     #  #    #    ##    #####    #####  ######  #####          #
  2966. #        #    #   #  #   #    #     #    #       #    #         #
  2967. #        ######  #    #  #    #     #    #####   #    #         ######
  2968. #        #    #  ######  #####      #    #       #####                #
  2969. #     #  #    #  #    #  #          #    #       #   #          #     #
  2970.  #####   #    #  #    #  #          #    ######  #    #          #####
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982. #######
  2983. #     #   #####  #    #  ######  #####
  2984. #     #     #    #    #  #       #    #
  2985. #     #     #    ######  #####   #    #
  2986. #     #     #    #    #  #       #####
  2987. #     #     #    #    #  #       #   #
  2988. #######     #    #    #  ######  #    #
  2989.  
  2990. #######
  2991. #        #    #  #    #   ####    #####     #     ####   #    #   ####
  2992. #        #    #  ##   #  #    #     #       #    #    #  ##   #  #
  2993. #####    #    #  # #  #  #          #       #    #    #  # #  #   ####
  2994. #        #    #  #  # #  #          #       #    #    #  #  # #       #
  2995. #        #    #  #   ##  #    #     #       #    #    #  #   ##  #    #
  2996. #         ####   #    #   ####      #       #     ####   #    #   ####
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.             Searching
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.         o  /string  -  moves cursor to occurence of string
  3019.         pattern.
  3020.  
  3021.         o  ?string  -  searches backward through the buffer
  3022.         for string pattern.
  3023.  
  3024.         o  n -  finds next occurence of the string pattern.
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.             Regular Expressions
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.         A Regular Expression is used to specify parts of a
  3042.     line.  It is used in search, substitute, and delete commands.  The
  3043.     concept is also used in many other UNIX commands, to include grep,
  3044.     sed, and jove.
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.         o  ^ - beginning of line.
  3051.  
  3052.         o  $ - end of line.
  3053.  
  3054.         o  . - matches any character.
  3055.  
  3056.         o  \ - delimits special characters.
  3057.  
  3058.         o [] - range of characters.
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.             Yanking
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.         o  yw -  yank word
  3081.  
  3082.         o  y$ -  yank to end of line
  3083.  
  3084.         o  yy -  yank line
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.             Yanking
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.         o  y(CR) - yank whole line
  3108.         o  y^ - yank from beginning of line to cursor
  3109.  
  3110.         o  yb - yank previous word        ***
  3111.         o  yB - yank previous long word        ***
  3112.  
  3113.         o  ye - yank to end of word
  3114.         o  yE - yank to end of long word
  3115.  
  3116.         o  yW - yank long word            ***
  3117.  
  3118.         o  yH - yank from beginning of window to cursor line
  3119.         o  yM - yank from curor line to middle of screen
  3120.         o  yL - yank from cursor to end of window
  3121.  
  3122.  
  3123.  
  3124.         *** numeric count can be added before command
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.             Putting Text
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.         o  puts last text object
  3148.  
  3149.         o  p - puts on next line or next character
  3150.  
  3151.         o  P - put on previous line or previous character
  3152.  
  3153.         o  xp - transposes character
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.             Screen Adjusting
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.         o  CTRL-L -  refresh screen.
  3178.  
  3179.         o  CTRL-E -  Scroll window down 1 line.
  3180.  
  3181.         o  CTRL-Y -  Scroll window up 1 line.
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.             Misc.
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.         o   J - Joins lines.  The line(s) below the cursor
  3207.             will be appended to the current line.  "2J" is equal
  3208.         to "J". "3J" will join the two line below the
  3209.         current line with the current line.
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.                 Summary 
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.             o  p - put text after cursor or line.
  3234.             o  y - yank text.
  3235.  
  3236.             o  J - join next line with cursor line.
  3237.             o  P - put text before cursor or line.
  3238.             o  Y - yank to end of line
  3239.  
  3240.             o  CTRL-E -  scroll window down 1 line.
  3241.             o  CTRL-Y -  scroll window up 1 line.
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  #####                                                           #####
  3251. #     #  #    #    ##    #####    #####  ######  #####          #     #
  3252. #        #    #   #  #   #    #     #    #       #    #         #
  3253. #        ######  #    #  #    #     #    #####   #    #         ######
  3254. #        #    #  ######  #####      #    #       #####          #     #
  3255. #     #  #    #  #    #  #          #    #       #   #          #     #
  3256.  #####   #    #  #    #  #          #    ######  #    #          #####
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268. ####### #     #
  3269. #        #   #
  3270. #         # #
  3271. #####      #
  3272. #         # #
  3273. #        #   #
  3274. ####### #     #
  3275.  
  3276. #     #
  3277. ##   ##   ####   #####   ######
  3278. # # # #  #    #  #    #  #
  3279. #  #  #  #    #  #    #  #####
  3280. #     #  #    #  #    #  #
  3281. #     #  #    #  #    #  #
  3282. #     #   ####   #####   ######
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.             Writing
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.         o  :w  - basic form of write command
  3306.  
  3307.         o  :y,xw filename
  3308.  
  3309.         o  :y,xw! filename
  3310.  
  3311.         o  :y,xw! !program
  3312.  
  3313.           y refers to the yth line of the file, x to the xth
  3314.         line of the file.  If the file already exists the !
  3315.         right after the w tells vi to overwrite the file.  filename
  3316.         refers to any file while !program means to write the
  3317.         file to the input of the program.
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.             Reading
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.         o  :r file  - will read file into the buffer
  3341.                 after the cursor.
  3342.  
  3343.         o  :xr file - will read file into the buffer
  3344.             after line x.
  3345.  
  3346.         o  :r !program - will read into the buffer after the
  3347.         cursor the output of executing program.
  3348.  
  3349.         o  :xr !program - will read into the buffer after
  3350.         line x the output of executing program.
  3351.  
  3352.         o  :x,y! program - will replace lines x through y
  3353.         with the output of executing program with input 
  3354.                 of lines x through y.
  3355.  
  3356.         o  :x,y! fmt - reformat these lines.
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.             Quit & File Commands
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.         o  :x  - write and quit the vi buffer.
  3382.         o  :wq - write and quit the vi buffer.
  3383.  
  3384.         o  :q  - quit vi.  Will not allow you to quit
  3385.         if any changes have been made to buffer.
  3386.  
  3387.         o  :q! - quit vi regardless of wheter any changes 
  3388.         have made made.
  3389.  
  3390.         o  :f  - print the name of the file & line number
  3391.         where cursor is located.
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.         Editing Multiple Files
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.     
  3411.             o vi file1 file2 file3
  3412.  
  3413.             o :n - will allow you to edit next file
  3414.  
  3415.             o :e  file 
  3416.             o :e! file  - change file to file
  3417.             o :e! %     - start over
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.             Deletion
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.         o  :1d    - deletes first line of file.
  3443.  
  3444.         o  :1,$d - deletes all lines from file.
  3445.  
  3446.         o  :1,5d - deletes lines 1 through 5 of file.
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.             Substitution
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.         o  :xs/RE/re/
  3472.         o  :xs/RE/re/g   - On line x substitute "re" for 
  3473.         "RE".  The g means do it for all lines.
  3474.  
  3475.         o  :1,$s/RE/re/g 
  3476.  
  3477.         As you can see, you can specify a line, lines, or the
  3478.         whole file to change.  Use the g option to make
  3479.         changes throughout the line rather than just the
  3480.         first occurence of a change in the line.
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.             Shell Escapes
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.         o  :sh
  3505.  
  3506.         o  :!sh
  3507.  
  3508.         o  :1,5!fmt
  3509.  
  3510.         Both ":sh" and ":!sh" will let you escape to the
  3511.         command processor.  When the shell is exited, control
  3512.         passes back to vi.  The form ":1,5!program" will
  3513.         execute a program with lines 1 through 5 being used as
  3514.         the standard input for the program.  The output of the
  3515.         program will replace lines 1 through 5 in the file.
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.             Global Substitions
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.         o  :g/RE/p  - global search and print.
  3542.  
  3543.         o  :g/RE/d  - will delete any line with RE in it.
  3544.  
  3545.         o  :g/RE/s//re will substitute re for RE globally
  3546.         through out the file.
  3547.  
  3548.         o  :g/RE/s/AB/CD/ - will substitute CD for AB
  3549.         wherever RE exists on a line.
  3550.  
  3551.  
  3552.         o  The p option will print to the terminal all lines
  3553.                 where the action was completed.
  3554.  
  3555.         o  v instead of g will do it for all ines that don't
  3556.         match.
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.             set
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.         o  :set all  - list all parameters
  3584.  
  3585.         o  :set nu
  3586.         o  :set nonu -  Turns on/off numbering for lines
  3587.            in file.
  3588.  
  3589.         o  :set list
  3590.         o  :set nolist - Turns on/off substituting "^I" for
  3591.         the tab character and $ for the (CR).
  3592.  
  3593.         o  :set wm=x  - sets the wrap margin.  If wm is set to
  3594.         0, cursor will not wrap around.  Cursor will wrap x
  3595.         spaces from right margin.
  3596.  
  3597.         o  all these parameters can go into a file called
  3598.         .exrc which will do this for all invocations of vi.
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.             map & ab
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.         o  ab chnage change - will change all occurrences of
  3626.         chnage with change when separated by whitespace when
  3627.         input in insert mode.
  3628.  
  3629.         o  map f :f   -  whenever f is hit in command mode
  3630.         will do :f instead of f.  Useful to define
  3631.         cursor keys.
  3632.  
  3633.         o  These can also be put into .exrc file.
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643. ####### #     #    #    #       #     #    #    #######   ###   ####### #     #
  3644. #       #     #   # #   #       #     #   # #      #       #    #     # ##    #
  3645. #       #     #  #   #  #       #     #  #   #     #       #    #     # # #   #
  3646. #####   #     # #     # #       #     # #     #    #       #    #     # #  #  #
  3647. #        #   #  ####### #       #     # #######    #       #    #     # #   # #
  3648. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  3649. #######    #    #     # #######  #####  #     #    #      ###   ####### #     #
  3650.  
  3651.  
  3652. 1)  What were your goals in taking this course?
  3653.  
  3654. ----------------------------------------------------------------------
  3655.  
  3656.  
  3657. 2)  Did you learn anything in this course?  
  3658.  
  3659. ----------------------------------------------------------------------
  3660.  
  3661. 3)  What did you think of the course notes?
  3662.  
  3663. ----------------------------------------------------------------------
  3664.  
  3665. ----------------------------------------------------------------------
  3666.  
  3667. ----------------------------------------------------------------------
  3668.  
  3669. 4)  Did you like the course?
  3670.  
  3671. ----------------------------------------------------------------------
  3672.  
  3673. ----------------------------------------------------------------------
  3674.  
  3675. 5)  What did you think of the instructor?
  3676.  
  3677. ----------------------------------------------------------------------
  3678.  
  3679. ----------------------------------------------------------------------
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.             Summary Of VI Commands
  3687.         
  3688.                         o  a  - appends after cursor
  3689.                         o  b  - back up a word
  3690.                         o  c  - changes text
  3691.                         o  d  - deletes text
  3692.                         o  e  - forward to end of word
  3693.                         o  h  - 1 space back
  3694.                         o  i  - insert before cursor
  3695.                         o  j  - 1 space down
  3696.                         o  k  - 1 space up
  3697.                         o  l  - 1 space forward
  3698.                         o  o  - Open a line below cursor
  3699.                         o  p  - put text after cursor or line
  3700.                         o  r  - replaces a character
  3701.                         o  u  - undoes last change
  3702.                         o  w  - forward to next word
  3703.                         o  y  - yank text
  3704.  
  3705.  
  3706.                         o  A  - appends at end of line
  3707.                         o  B  - back up a word
  3708.                         o  C  - changes to end of line
  3709.                         o  D  - deletes to end of line
  3710.                         o  E  - forward to end of word
  3711.                         o  G  - last line of file
  3712.                         o  H  - Home or 1st Line
  3713.                         o  I  - insert at beginning of line
  3714.                         o  L  - Last Line
  3715.                         o  J -  join next line with cursor line
  3716.                         o  P -  put text before cursor or line
  3717.                         o  M  - Middle Line
  3718.                         o  O  - Open a line above cursor
  3719.                         o  R  - overwrites text
  3720.                         o  U  - undoes all changes to line
  3721.                         o  W  - forward to next word
  3722.                         o  Y -  yank to end of line
  3723.  
  3724.                         o  CTRL-B - Back a screen
  3725.                         o  CTRL-D - Forward 1/2 screen
  3726.                         o  CTRL-E - scroll window down 1 line
  3727.                         o  CTRL-F - Forward a screen
  3728.                         o  CTRL-G - Displays current info
  3729.                         o  CTRL-U - Back 1/2 screen
  3730.                         o  CTRL-V - insert control characters
  3731.                         o  CTRL-Y - scroll window up 1 line
  3732.  
  3733.  
  3734.                                                       #####
  3735. #     #  #    #    ##    #####    #####  ######  #####          #     #
  3736. #        #    #   #  #   #    #     #    #       #    #         #
  3737. #        ######  #    #  #    #     #    #####   #    #         ######
  3738. #        #    #  ######  #####      #    #       ####vi/head/   755   1552     12           0  4553142453   5364 vi/head/head.1   755   1552     12        1170  4551160275   6436 
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.         #     #   ###
  3747.         #     #    #
  3748.         #     #    #
  3749.         #     #    #
  3750.          #   #     #
  3751.           # #      #
  3752.            #      ###
  3753.         
  3754.     
  3755.     
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.           ####    ####   #    #  #####    ####   ######
  3766.          #    #  #    #  #    #  #    #  #       #
  3767.          #       #    #  #    #  #    #   ####   #####
  3768.          #       #    #  #    #  #####        #  #
  3769.          #    #  #    #  #    #  #   #   #    #  #
  3770.           ####    ####    ####   #    #   ####   ######
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.         Developed by Analytical Evaluation Branch, FSAC
  3777.         Revision 2.1    13 Nov 1989
  3778.         Author:        Dennis G. Rears
  3779.         EMail Address:    <drears@pica.army.mil>
  3780.         Phone:        (201) 724-2683
  3781.         UPS:        Box 210, Wharton, NJ  07885
  3782.  
  3783.  
  3784.  
  3785. for AB
  3786.         wherever RE exists on a line.
  3787.  
  3788.  
  3789.         o  The p option will print to the terminal all lines
  3790.                 where the action was completed.
  3791.  
  3792.         o  v instead of g will do it for all ines that don't
  3793.         match.
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.             set
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.         o  :set all  - list all parameters
  3821.  
  3822.         o  :set nu
  3823.         o  :set nonu -  Turns on/off numbering for lines
  3824.            in file.
  3825.  
  3826.         o  :set list
  3827.         o  :set nolist -vi/head/.head.2   755   1552     12         255  4400540161   6465 
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.             TABLE OF CONTENTS
  3838.  
  3839.  
  3840.  
  3841.             1.  Introduction
  3842.  
  3843.             2.  Inserting Text
  3844.  
  3845.             3.  Deleting Text
  3846.  
  3847.             4.  Changing Text
  3848.  
  3849.             5.  Ex Mode
  3850.  
  3851.             6.  Hints 
  3852.  
  3853.             7.  Man Pages 
  3854.  
  3855.  ######
  3856.          #    #  #    #  #    #  #    #  #       #
  3857.          #       #    #  #    #  #    #   ####   #####
  3858.          #       #    #  #    #  #####        #  #
  3859.          #    #  #    #  #    #  #   #   #    #  #
  3860.           ####    ####    ####   #    #   ####   ######
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.         Developed by Analytical Evaluation Branch, FSAC
  3867.         Revision 2.1    13 Nov 1989
  3868.         Author:        Dvi/head/head.2   755   1552     12        1154  4552113215   6432 
  3869.  
  3870.  
  3871.  
  3872.             VI Course
  3873.  
  3874.  
  3875.         Revision History
  3876.  
  3877.     2.1    13 Nov 1989   Dennis Rears   <drears>
  3878.  
  3879.         Minor corrections.
  3880.  
  3881.     2.0    27 June 1989  Dennis Rears   <drears>
  3882.  
  3883.            Changed representation of control characters to CTRL.
  3884.            Expanded EX section.
  3885.     
  3886.  
  3887.  
  3888.     1.1    21 Mar 1989  Dennis Rears
  3889.  
  3890.            Rewrote course, greatly expanding "outline".
  3891.  
  3892.  
  3893.     1.0     Circa 1988  Dennis Rears
  3894.  
  3895.         Original Course.
  3896.  
  3897.  
  3898.  
  3899.  
  3900.         Developed by Analytical Evaluation Branch, FSAC
  3901.         Host:        caesar.pica.army.mil
  3902.         Location:    /u1/drears/teach/vi/course
  3903.         Author:        Dennis G. Rears
  3904.         EMail Address:    <drears@pica.army.mil>
  3905.         Phone:        (201) 724-2683
  3906.         Date:          27 June 1989
  3907.  
  3908.  
  3909.  
  3910.  
  3911.   07885
  3912.  
  3913.  
  3914.  
  3915. for AB
  3916.         wherever RE exists on a line.
  3917.  
  3918.  
  3919.         o  The p option will print to the terminal all lines
  3920.                 where the action was completed.
  3921.  
  3922.         o  v instead of g will do it for all ines that don't
  3923.         match.
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.             set
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.         o  :set all  - list all parameters
  3951.  
  3952.         o  :set nu
  3953.         o  :set nonu -  Turns on/off numbering for lines
  3954.            in file.
  3955.  
  3956.         o  :set list
  3957.         o  :set nolist -vi/head/head.3   755   1552     12         261  4452467103   6420 
  3958.  
  3959.  
  3960.  
  3961.  
  3962.             VI Course
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.  
  3974.         Table of Contents
  3975.  
  3976.  
  3977.         1) Introduction
  3978.  
  3979.         2) Navigation
  3980.  
  3981.         3) Inserting Text
  3982.  
  3983.         4) Deleting/Changing Text
  3984.  
  3985.         5) Other Functions
  3986.  
  3987.            6) Ex Mode
  3988.  
  3989. of control characters to CTRL.
  3990.            Expanded EX section.
  3991.     
  3992.  
  3993.  
  3994.     1.1    21 Mar 1989  Dennis Rears
  3995.  
  3996.            Rewrote course, greatly expanding "outline".
  3997.  
  3998.  
  3999.     1.0     Circa 1988  Dennis Rears
  4000.  
  4001.         Original Course.
  4002.  
  4003.  
  4004.  
  4005.  
  4006.         Developed by Analytical Evaluation Branch, FSAC
  4007.         Host:        caesar.pica.army.mil
  4008.         Location:    /u1/drears/teach/vi/course
  4009.         Author:        Devi/4/   755   1552     12           0  4553142457   4632 vi/4/4.0   755   1552     12        3223  4452471135   5142 
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  #####                                                          #
  4017. #     #  #    #    ##    #####    #####  ######  #####          #    #
  4018. #        #    #   #  #   #    #     #    #       #    #         #    #
  4019. #        ######  #    #  #    #     #    #####   #    #         #    #
  4020. #        #    #  ######  #####      #    #       #####          #######
  4021. #     #  #    #  #    #  #          #    #       #   #               #
  4022.  #####   #    #  #    #  #          #    ######  #    #              #
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032. ######                                                                #
  4033. #     #  ######  #       ######   #####     #    #    #   ####       #
  4034. #     #  #       #       #          #       #    ##   #  #    #     #
  4035. #     #  #####   #       #####      #       #    # #  #  #         #
  4036. #     #  #       #       #          #       #    #  # #  #  ###   #
  4037. #     #  #       #       #          #       #    #   ##  #    #  #
  4038. ######   ######  ######  ######     #       #    #    #   ####  #
  4039.  
  4040.  #####
  4041. #     #  #    #    ##    #    #   ####      #    #    #   ####
  4042. #        #    #   #  #   ##   #  #    #     #    ##   #  #    #
  4043. #        ######  #    #  # #  #  #          #    # #  #  #
  4044. #        #    #  ######  #  # #  #  ###     #    #  # #  #  ###
  4045. #     #  #    #  #    #  #   ##  #    #     #    #   ##  #    #
  4046.  #####   #    #  #    #  #    #   ####      #    #    #   ####
  4047.  
  4048.                 #######
  4049.                    #     ######  #    #   #####
  4050.                    #     #        #  #      #
  4051.                    #     #####     ##       #
  4052.                    #     #         ##       #
  4053.                    #     #        #  #      #
  4054.                    #     ######  #    #     #
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062. ####### #     #    #    #       #     #    #    #######   ###   ####### #     #
  4063. #       #     #   # #   #       #     #   # #      #       #    #     # ##    #
  4064. #       #     #  #   #  #       #     #  #   #     #       #    #     # # #   #
  4065. #####   #     # #     # #       #     # #     #    #       #    #     # #  #  #
  4066. #        #   #  ####### #       #     # vi/4/4.4   755   1552     12         204  4452471235   5123 
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.             Changing Text
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.         o  r - Replace one character.
  4086.  
  4087.         o  R - Overwrite text in insert mode.
  4088.  
  4089.         o  ~ - Change case
  4090.  
  4091.      #    #
  4092. #        #    #   #  #   #    #     #    #       #    #         #    #
  4093. #        ######  #    #  #    #     #    #####   #    #         #    #
  4094. #        #    #  ######  #####      #    #       #####          #######
  4095. #     #  #    #  #    #  #          #    #       #   #               #
  4096.  #####   #    #  #    #  #          #    ######  #    #              #
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106. ###vi/4/4.6   755   1552     12         265  4411536623   5132 
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.             Changing Text
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.         o  cw - change word            ***
  4126.  
  4127.         o  c$ - change to end of line
  4128.  
  4129.         o  C  - change to end of line
  4130.  
  4131.         *** Numeric count can be added before command
  4132.  
  4133.  
  4134.     #       #    #         #    #
  4135. #        ######  #    #  #    #     #    #####   #    #         #    #
  4136. #        #    #  ######  #####      #    #       #####          #######
  4137. #     #  #    #  #    #  #          #    #       #   #               #
  4138.  #####   #    #  #    #  #          #    ######  #    #              #
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148. ###vi/4/4.8   755   1552     12         151  4404746630   5131 
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.             Undoing Stuff
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.         o  u - undo last change
  4169.  
  4170.         o  U - undo all changes to last line
  4171.  
  4172.  
  4173. - change to end of line
  4174.  
  4175.         *** Numeric count can be added before command
  4176.  
  4177.  
  4178.     #       #    #         #    #
  4179. #        ######  #    #  #    #     #    #####   #    #         #    #
  4180. #        #    #  ######  #####      #    #       #####          #######
  4181. #     #  #    #  #    #  #          #    #       #   #               #
  4182.  #####   #    #  #    #  #          #    ######  #    #              #
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192. ###vi/4/4.2   755   1552     12         446  4411536560   5127 
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.             Deleting Text
  4200.             Main Delete Commands
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.         o  x - delete current character     ***
  4212.  
  4213.         o  dw - delete word                ***
  4214.  
  4215.         o  d$ - delete to end of line
  4216.         o  D  - delete to end of line
  4217.  
  4218.         o  dd - delete whole line        ***
  4219.  
  4220.  
  4221.  
  4222.         *** numeric count can be added before command
  4223.  
  4224.  #    #  ######  #####      #    #       #####          #######
  4225. #     #  #    #  #    #  #          #    #       #   #               #
  4226.  #####   #    #  #    #  #          #    ######  #    #              #
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236. ###vi/4/4.3   755   1552     12        1106  4527622031   5137 
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.             Deleting Text
  4244.             cursor characters
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.         o  d(CR) - delete whole line
  4256.         o  d^ - delete from beginning of line to cursor
  4257.  
  4258.         o  db - delete previous word        ***
  4259.         o  dB - delete previous long word    ***
  4260.  
  4261.         o  de - delete to end of word
  4262.         o  dE - delete to end of long word
  4263.  
  4264.         o  dW - delete long word        ***
  4265.  
  4266.         o  dH - delete from beginning of window to cursor line
  4267.         o  dM - delete from curor line to middle of screen
  4268.         o  dL - delete from cursor to end of window
  4269.  
  4270.  
  4271.  
  4272.         *** numeric count can be added before command
  4273.     
  4274.         These are not normally used except by expert users.
  4275.  
  4276.      #  ######  #       ######   #####     #    #    #   ####       #
  4277. #     #  #       #       #          #       #    ##   #  #    #     #
  4278. #     #  #####   #       #####      #       #    # #  #  #         #
  4279. #     #  #       #       #          #       #    #  # #  #  ###   #
  4280. #     #  #       #       #          #       #    #   ##  #    #  #
  4281. ######   ######  ######  ######     #       #    #    #   ####  #
  4282.  
  4283.  #####
  4284. #     #  #    #    ##   vi/4/4.1   755   1552     12         523  4452471161   5122 
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.             Deleting Text
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.         o  Deleting text is either done a character, word,
  4304.  
  4305.         line, or region at a time.  By placing a number
  4306.  
  4307.         in front of the delete expression the action can be 
  4308.  
  4309.         done many times.
  4310.  
  4311.  
  4312.         o  Deleting an expression will put it in a buffer.
  4313.  
  4314.         The put command will place a copy of it after 
  4315.  
  4316.         the cursor.
  4317.  
  4318.  
  4319. beginning of window to cursor line
  4320.         o  dM - delete from curor line to middle of screen
  4321.         o  dL - delete from cursor to end of window
  4322.  
  4323.  
  4324.  
  4325.         *** numeric count can be added befvi/4/4.5   755   1552     12         563  4452471367   5142 
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.             Changing Text
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.         o  Changing text is either done a character, word,
  4346.  
  4347.         line, or region at a time.  By placing a number
  4348.  
  4349.         in front of the change expression, the action can be 
  4350.  
  4351.         done many times.
  4352.  
  4353.  
  4354.  
  4355.         o  In changing more than a word, vi deletes
  4356.  
  4357.                 the expression, and enters into insert mode at 
  4358.  
  4359.         the beginning of the expression.
  4360.  
  4361.  
  4362. ne
  4363.         o  dM - delete from curor line to middle of screen
  4364.         o  dL - delete from cursor to end of window
  4365.  
  4366.  
  4367.  
  4368.         *** numeric count can be added befvi/4/4.7   755   1552     12        1100  4527622073   5143 
  4369.  
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.             Changing Text
  4377.             cursor characters
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.         o  c(CR) - change whole line
  4389.         o  c^ - change from beginning of line to cursor
  4390.  
  4391.         o  cb - change previous word        ***
  4392.         o  cB - change previous long word    ***
  4393.  
  4394.         o  ce - change to end of word
  4395.         o  cE - change to end of word
  4396.  
  4397.         o  cW - change long word        ***
  4398.  
  4399.         o  cH - change from beginning of window to cursor line
  4400.         o  cM - change from curor line to middle of screen
  4401.         o  cL - change from cursor to end of window
  4402.  
  4403.  
  4404.  
  4405.         *** numeric count can be added before command
  4406.         These are not normally used except by expert users.
  4407.  
  4408. rs.
  4409.  
  4410.      #  ######  #       ######   #####     #    #    #   ####       #
  4411. #     #  #       #       #          #       #    ##   #  #    #     #
  4412. #     #  #####   #       #####      #       #    # #  #  #         #
  4413. #     #  #       #       #          #       #    #  # #  #  ###   #
  4414. #     #  #       #       #          #       #    #   ##  #    #  #
  4415. ######   ######  ######  ######     #       #    #    #   ####  #
  4416.  
  4417.  #####
  4418. #     #  #    #    ##   vi/4/4.9   755   1552     12         420  4411760025   5121 
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.                 Summary 
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.             o  c - changes text
  4439.             o  d - deletes text
  4440.             o  r - replaces a character
  4441.             o  u - undoes last change
  4442.  
  4443.             o  C - changes to end of line
  4444.             o  D - deletes to end of line
  4445.             o  R - overwrites text
  4446.             o  U - undoes all changes to line
  4447.  
  4448.  
  4449.  
  4450. f word
  4451.  
  4452.         o  cW - change long word        ***
  4453.  
  4454.         o  cH - change from beginning of window to cursor line
  4455.         o  cM - change from curor line to middle of screen
  4456.         o  cL - change from cursor to end of window
  4457.  
  4458.  
  4459.  
  4460.         *** numeric count can be added before vi/1/   755   1552     12           0  4553142454   4624 vi/1/1.0   755   1552     12        1237  4411536732   5137 
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.   ####   #    #    ##    #####    #####  ######  #####            ##
  4467.  #    #  #    #   #  #   #    #     #    #       #    #          # #
  4468.  #       ######  #    #  #    #     #    #####   #    #            #
  4469.  #       #    #  ######  #####      #    #       #####             #
  4470.  #    #  #    #  #    #  #          #    #       #   #             #
  4471.   ####   #    #  #    #  #          #    ######  #    #          #####
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.     #    #    #   #####  #####    ####
  4481.     #    ##   #     #    #    #  #    #
  4482.     #    # #  #     #    #    #  #    #
  4483.     #    #  # #     #    #####   #    #
  4484.     #    #   ##     #    #   #   #    #
  4485.     #    #    #     #    #    #   ####
  4486.  
  4487.  
  4488.       #          #       #    ##   #  #    #     #
  4489. #     #  #####   #       #####      #       #    # #  #  #         #
  4490. #     #  #       #       #          #       #    #  # #  #  ###   #
  4491. #     #  #       #       #          #       #    #   ##  #    #  #
  4492. ######   ######  ######  ######     #       #    #    #   ####  #
  4493.  
  4494.  #####
  4495. #     #  #    #    ##   vi/1/1.1   755   1552     12         324  4551160627   5115 
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.             INTRODUCTION
  4502.  
  4503.  
  4504.  
  4505.         o Ed Family of Editors
  4506.  
  4507.             o e
  4508.             o edit
  4509.             o ex
  4510.             o view
  4511.             o vi
  4512.  
  4513.  
  4514.         o Full Screen Editor
  4515.  
  4516.             o Terminal Type
  4517.  
  4518.  
  4519.         o Developed by UC at Berkeley
  4520.             
  4521.             o Bill Joy
  4522.             o Mike Horton
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  #       #    #  ######  #####      #    #       #####             #
  4528.  #    #  #    #  #    #  #          #    #       #   #             #
  4529.   ####   #    #  #    #  #          #    ######  #    #          #####
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.     #    #    #   #####  #####    ####
  4539.     #    ##   #     #    #    #  #    #
  4540.    vi/1/1.2   755   1552     12        1165  4527621033   5136 
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.             
  4547.             Important Terms
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.     
  4554.     o VI - VIsual Editor, a full screen editor used by all UNIX
  4555.         systems.
  4556.  
  4557.     o shell - The command processor.
  4558.  
  4559.     o shell escape - An action that allows the user to issue a
  4560.     shell command from a running program. 
  4561.  
  4562.     o buffer - A temporary place to store info.
  4563.  
  4564.     o file - A permament place to store data.
  4565.  
  4566.     o unix - The operating system in use on ARDEC workplace
  4567.         automation machines.
  4568.  
  4569.     o Control Character - A character represented by "CTRL X".
  4570.     To make the character the Control and letter key must be
  4571.     hit at the same time.
  4572.  
  4573.     o White Space - A tab, space, or new line character.
  4574.  
  4575.  
  4576.  
  4577.  
  4578.     #    #    #     #    #    #   ####
  4579.  
  4580.  
  4581.       #          #       #    ##   #  #    #     #
  4582. #     #  #####   #       #####      #       #    # #  #  #         #
  4583. #     #  #       #       #          #       #    #  # #  #  ###   #
  4584. #     #  #       #       #          #       #    #   ##  #    #  #
  4585. ######   ######  ######  ######     #       #    #    #   ####  #
  4586.  
  4587.  #####
  4588. #     #  #    #    ##   vi/1/1.3   755   1552     12        1064  4551160671   5140 
  4589.  
  4590.  
  4591.  
  4592.  
  4593.             Modes
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.          VI works in three different modes. They are:
  4601.  
  4602.  
  4603.             o  Insert Mode -  This mode is used when
  4604.         appending, inserting, changing, and replacing text. 
  4605.  
  4606.             o  Ex Mode -  This mode allows for use of 
  4607.         the ex set of commands.  This mode can act on one line
  4608.         at a time, several lines at a time, or every line.
  4609.         Shell escapes are executed at this level.
  4610.  
  4611.             o  Command Mode - Vi begins in this mode.
  4612.         This mode allows you to switch to the other modes.  
  4613.         In addition, deleting, transposing, yanking, and 
  4614.         other functions are performed here.
  4615.  
  4616.  
  4617. ime.
  4618.  
  4619.     o White Space - A tab, space, or new line character.
  4620.  
  4621.  
  4622.  
  4623.  
  4624.     #    #    #     #    #    #   ####
  4625.  
  4626.  
  4627.       #          #       #    ##   #  #    #     #
  4628. #     #  #####   #       #####      #       #    # #  #  #         #
  4629. #     #  #       #       #          #       #    #  # #  #  ###   #
  4630. #     #  #       #       #          #       #    #   ##  #    #  #
  4631. ######   ######  ######  ######     #       #    #    #   ####  #
  4632.  
  4633.  #####
  4634. #     #  #    #    ##   vi/1/1.4   755   1552     12         550  4551160705   5116 
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.             IMPORTANT KEYS
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650.         o  ESCAPE - Exits insert mode.
  4651.  
  4652.         o  COLON - Enters ex mode.
  4653.  
  4654.         o  BANG (!) - shell escape.
  4655.  
  4656.         o  TILDE (~) - no line is present as opposed
  4657.                    to nothing on the line. 
  4658.  
  4659.         o  CTRL L - screen refresh or form feed.
  4660.  
  4661.  
  4662.            CTRL L indicates that the "L" key and the
  4663.         Control key are depressed at the same time.
  4664.  
  4665. is level.
  4666.  
  4667.             o  Command Mode - Vi begins in this mode.
  4668.         This mode allows you to switch to the other modes.  
  4669.         In addition, deleting, transposing, yanvi/2/   755   1552     12           0  4553142455   4626 vi/2/2.0   755   1552     12        1744  4452467765   5162 
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  #####                                                           #####
  4676. #     #  #    #    ##    #####    #####  ######  #####          #     #
  4677. #        #    #   #  #   #    #     #    #       #    #               #
  4678. #        ######  #    #  #    #     #    #####   #    #          #####
  4679. #        #    #  ######  #####      #    #       #####          #
  4680. #     #  #    #  #    #  #          #    #       #   #          #
  4681.  #####   #    #  #    #  #          #    ######  #    #         #######
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691. #     #
  4692. ##    #    ##    #    #     #     ####     ##     #####     #     ####   #    #
  4693. # #   #   #  #   #    #     #    #    #   #  #      #       #    #    #  ##   #
  4694. #  #  #  #    #  #    #     #    #       #    #     #       #    #    #  # #  #
  4695. #   # #  ######  #    #     #    #  ###  ######     #       #    #    #  #  # #
  4696. #    ##  #    #   #  #      #    #    #  #    #     #       #    #    #  #   ##
  4697. #     #  #    #    ##       #     ####   #    #     #       #     ####   #    #
  4698.  
  4699.  
  4700. ###
  4701. #     #  #    #    ##   vi/2/2.1   755   1552     12         452  4452470267   5125 
  4702.  
  4703.  
  4704.  
  4705.  
  4706.  
  4707.             What is a line?
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.         o  Physical Line -  the maximum characters
  4719.         your screen can hold in a line.
  4720.  
  4721.         o  Logical Line  -  A line terminated by the <CR> 
  4722.         character.
  4723.  
  4724.         o  At most, one logical line can fit into one
  4725.         physical line but physical line can fit into 
  4726.         a logical line.
  4727.  
  4728.    #    #  ######  #####      #    #       #####          #
  4729. #     #  #    #  #    #  #          #    #       #   #          #
  4730.  #####   #    #  #    #  #          #    ######  #    #         #######
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740. #     #vi/2/2.3   755   1552     12         724  4452470356   5130 
  4741.  
  4742.  
  4743.  
  4744.             Navigation
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.         o  cursor keys
  4756.  
  4757.         o  home keys
  4758.  
  4759.             o h  -  1 space back        ***
  4760.             o j  -  1 space down        ***
  4761.             o k  -  1 space up        ***
  4762.             o l  -  1 space forward        ***
  4763.  
  4764.         o  screen keys
  4765.  
  4766.             o H -  Home or 1st Line
  4767.             o M -  Middle Line
  4768.             o L -  Last Line
  4769.  
  4770.         o control keys
  4771.  
  4772.             o CTRL-B - back a screen
  4773.             o CTRL-F - forward a screen
  4774.             o CTRL-U - Up half a screen
  4775.             o CTRL-D - Down half a screen
  4776.  
  4777.  
  4778.         *** a numeric count can be added before the command.
  4779.  
  4780. ###  #    #         #######
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790. #     #vi/2/2.5   755   1552     12         657  4452470470   5134 
  4791.  
  4792.  
  4793.  
  4794.  
  4795.             Navigation Within A Line
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.         o  Word Navigation (not including punctuation)
  4807.  
  4808.             o  b - back up a word
  4809.  
  4810.             o  e - forward to end of word
  4811.  
  4812.             o  w - forward to next word
  4813.  
  4814.  
  4815.         o Bigger Word (includes punctuation)
  4816.  
  4817.  
  4818.             o  B - back up a word
  4819.  
  4820.             o  E - forward to end of word
  4821.  
  4822.             o  W - forward to next word
  4823.  
  4824.         o Numeric count can be added before all of these commands
  4825.           
  4826.             o e.g. 5e - forward to end of fifth word.
  4827.  
  4828. t can be added before the command.
  4829.  
  4830. ###  #    #         #######
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840. #     #vi/2/2.7   755   1552     12        1126  4527621224   5144 
  4841.  
  4842.  
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.                   Summary
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.             o  b  - back up a word
  4859.             o  e  - forward to end of word
  4860.             o  h  -  1 space back
  4861.             o  j  -  1 space down
  4862.             o  k  -  1 space up
  4863.             o  l  -  1 space forward
  4864.             o  w  - forward to next word
  4865.  
  4866.             o  B  - back up a word
  4867.             o  E  - forward to end of word
  4868.                 o  G  - last line of file
  4869.             o  H  -  Home or 1st Line
  4870.             o  L  -  Last Line
  4871.             o  M  -  Middle Line
  4872.             o  W  - forward to next word
  4873.  
  4874.             o  CTRL-B - Back a screen
  4875.             o  CTRL-D - Forward 1/2 screen
  4876.             o  CTRL-F - Forward a screen
  4877.             o  CTRL-G - Displays current info
  4878.             o  CTRL-U - Back 1/2 screen
  4879.  
  4880.  
  4881.  #   #  #   #    #     #    #    #   #  #      #       #    #    #  ##   #
  4882. #  #  #  #    #  #    #     #    #       #    #     #       #    #    #  # #  #
  4883. #   # #  ######  #    #     #    #  ###  ######     #       #    #    #  #  # #
  4884. #    ##  #    #   #  #      #    #    #  #    #     #       #    #    #  #   ##
  4885. #     #  #    #    ##       #     ####   #    #     #       #     ####   #    #
  4886.  
  4887.  
  4888. ###
  4889. #     #  #    #    ##   vi/2/2.6   755   1552     12         352  4527621314   5123 
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.             Navigating
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.         o  0  - First character of file.
  4907.  
  4908.         o  ^  - First non-whitespace character.
  4909.  
  4910.         o  $  - End of line.
  4911.  
  4912.         o  xG - line x of the file.
  4913.  
  4914.         o  G  - Last line of file.
  4915.  
  4916.         o  CTRL-G - Displays current info
  4917.  
  4918.  
  4919.  
  4920. B  - back up a word
  4921.             o  E  - forward to end of word
  4922.                 o  G  - last line of file
  4923.             o  H  -  Home or 1st Line
  4924.             o  L  -  Last Line
  4925.             o  M  -  Middle Line
  4926.             o  W  - forward to next word
  4927.  
  4928.             o  CTRL-B - Back a screen
  4929.             o  CTRL-D - Forward 1/2 screen
  4930.             o  CTRL-F - Fovi/2/2.2   755   1552     12         642  4452470125   5120 
  4931.  
  4932.  
  4933.  
  4934.  
  4935.              Navigation
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.         o  VI lets you move the cursor a character, word,
  4947.                  line, or region at a time.
  4948.  
  4949.         o  As with other functions keys, a numeric count can
  4950.            be added before the key to repeat the function.
  4951.  
  4952.         o  Example:
  4953.  
  4954.             o h will move the cursor back 1 character
  4955.  
  4956.             o 4h will move the cursor back 4 characters
  4957.  
  4958.         o  VI will not let you navigate before the beginning
  4959.         or end of the file.
  4960.  
  4961. to next word
  4962.  
  4963.             o  CTRL-B - Back a screen
  4964.             o  CTRL-D - Forward 1/2 screen
  4965.             o  CTRL-F - Fovi/2/2.8   755   1552     12         300  4452470646   5125 
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.             Navigating.
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.         Exercise #1  
  4984.  
  4985.         o  Use view instead of vi
  4986.  
  4987.         o  file name is movement
  4988.     
  4989.         o  practice moving around file 
  4990.  
  4991.         o  Use ESC :q! to exit
  4992.  
  4993.         o  Take a break!!!!
  4994.  
  4995. fore the key to repeat the function.
  4996.  
  4997.         o  Example:
  4998.  
  4999.             o h will move the cursor back 1 character
  5000.  
  5001.             o 4h will move the cursor back 4 characters
  5002.  
  5003.         o  VI will not let you navigate before the beginning
  5004.         or end of the file.
  5005.  
  5006. to next word
  5007.  
  5008.             o  CTRL-B - Back a screen
  5009.             o  CTRL-D - Forward 1/2 screen
  5010.             o  CTRL-F - Fovi/3/   755   1552     12           0  4553142456   4630 vi/3/3.0   755   1552     12        2167  4404553067   5150 
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  #####                                                           #####
  5018. #     #  #    #    ##    #####    #####  ######  #####          #     #
  5019. #        #    #   #  #   #    #     #    #       #    #               #
  5020. #        ######  #    #  #    #     #    #####   #    #          #####
  5021. #        #    #  ######  #####      #    #       #####                #
  5022. #     #  #    #  #    #  #          #    #       #   #          #     #
  5023.  #####   #    #  #    #  #          #    ######  #    #          #####
  5024.  
  5025.  
  5026.  
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.   ###
  5035.    #     #    #   ####   ######  #####    #####     #    #    #   ####
  5036.    #     ##   #  #       #       #    #     #       #    ##   #  #    #
  5037.    #     # #  #   ####   #####   #    #     #       #    # #  #  #
  5038.    #     #  # #       #  #       #####      #       #    #  # #  #  ###
  5039.    #     #   ##  #    #  #       #   #      #       #    #   ##  #    #
  5040.   ###    #    #   ####   ######  #    #     #       #    #    #   ####
  5041.  
  5042. #######
  5043.    #     ######  #    #   #####
  5044.    #     #        #  #      #
  5045.    #     #####     ##       #
  5046.    #     #         ##       #
  5047.    #     #        #  #      #
  5048.    #     ######  #    #     #
  5049.  
  5050.  
  5051.  #    #  # #  #  #          #    # #  #  #
  5052. #        #    #  ######  #  # #  #  ###     #    #  # #  #  ###
  5053. #     #  #    #  #    #  #   ##  #    #     #    #   ##  #    #
  5054.  #####   #    #  #    #  #    #   ####      #    #    #   ####
  5055.  
  5056.                 #######
  5057.                    #     ######  #    #   #####
  5058.                    #     #        #  #      #
  5059.                    #     #####     ##   vi/3/3.2   755   1552     12         462  4411540745   5123 
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.             Inserting Text
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.         o  Insert Commands
  5078.  
  5079.             o  i - insert before cursor
  5080.  
  5081.             o  I - insert at beginning of line
  5082.  
  5083.  
  5084.         o  Append Commands
  5085.  
  5086.             o  a - appends after cursor
  5087.  
  5088.             o  A - appends at end of line
  5089.  
  5090.  
  5091.         o  Either way in Insert Mode
  5092.  
  5093.         o  Numeric count can be added before these commands
  5094.  
  5095.  #  ######  #####      #    #       #####                #
  5096. #     #  #    #  #    #  #          #    #       #   #          #     #
  5097.  #####   #    #  #    #  #          #    ######  #    #          #####
  5098.  
  5099.  
  5100.  
  5101.  
  5102. vi/3/3.1   755   1552     12         374  4452470771   5132 
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.             Inserting Text
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.  
  5120.         o  Will be in Insert mode.
  5121.  
  5122.         o  Escape will get you out.
  5123.  
  5124.             o ESC ZZ -  write file and leave vi.
  5125.  
  5126.             o ESC :wq - write file and leave vi.
  5127.  
  5128.             o ESC -  Placed back into command mode.
  5129.  
  5130.         o  Cursor is key element.
  5131.  
  5132. o  Numeric count can be added before these commands
  5133.  
  5134.  #  ######  #####      #    #       #####                #
  5135. #     #  #    #  #    #  #          #    #       #   #          #     #
  5136.  #####   #    #  #    #  #          #    ######  #    #          #####
  5137.  
  5138.  
  5139.  
  5140.  
  5141. vi/3/3.3   755   1552     12         203  4404554345   5120 
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.             Inserting Text
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.         o  Open a line
  5161.  
  5162.             o  O  - Open a line above cursor
  5163.  
  5164.             o  o  - Open a line below cursor
  5165.  
  5166.  
  5167.  
  5168.  vi.
  5169.  
  5170.             o ESC :wq - write file and leave vi.
  5171.  
  5172.             o ESC -  Placed back into command mode.
  5173.  
  5174.         o  Cursor is key element.
  5175.  
  5176. o  Numeric count can be added before these commands
  5177.  
  5178.  #  ######  #####      #    #       #####                #
  5179. #     #  #    #  #    #  #          #    #       #   #          #     #
  5180.  #####   #    #  #    #  #          #    ######  #    #          #####
  5181.  
  5182.  
  5183.  
  5184.  
  5185. vi/3/3.4   755   1552     12         143  4451736265   5131 
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.             Misc. Commands
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.         o  ^V - insert control characters
  5206.  
  5207.         o  .  - Do it Again
  5208.  
  5209.  
  5210.  - Open a line below cursor
  5211.  
  5212.  
  5213.  
  5214.  vi.
  5215.  
  5216.             o ESC :wq - write file and leave vi.
  5217.  
  5218.             o ESC -  Placed back into command mode.
  5219.  
  5220.         o  Cursor is key element.
  5221.  
  5222. o  Numeric count can be added before these commands
  5223.  
  5224.  #  ######  #####      #    #       #####                #
  5225. #     #  #    #  #    #  #          #    #       #   #          #     #
  5226.  #####   #    #  #    #  #          #    ######  #    #          #####
  5227.  
  5228.  
  5229.  
  5230.  
  5231. vi/3/3.5   755   1552     12         431  4527621553   5127 
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.             Summary Text
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.             o  a - appends after cursor
  5251.             o  i - insert before cursor
  5252.             o  o - Open a line below cursor
  5253.  
  5254.             o  A - appends at end of line
  5255.             o  I - insert at beginning of line
  5256.             o  O - Open a line above cursor
  5257.  
  5258.             o CTRL-V - insert control characters
  5259.  
  5260.  before these commands
  5261.  
  5262.  #  ######  #####      #    #       #####                #
  5263. #     #  #    #  #    #  #          #    #       #   #          #     #
  5264.  #####   #    #  #    #  #          #    ######  #    #          #####
  5265.  
  5266.  
  5267.  
  5268.  
  5269. vi/6/   755   1552     12           0  4553142461   4627 vi/6/6.96   755   1552     12        2632  4453661327   5255 
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276. ####### #     #    #    #       #     #    #    #######   ###   ####### #     #
  5277. #       #     #   # #   #       #     #   # #      #       #    #     # ##    #
  5278. #       #     #  #   #  #       #     #  #   #     #       #    #     # # #   #
  5279. #####   #     # #     # #       #     # #     #    #       #    #     # #  #  #
  5280. #        #   #  ####### #       #     # #######    #       #    #     # #   # #
  5281. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  5282. #######    #    #     # #######  #####  #     #    #      ###   ####### #     #
  5283.  
  5284.  
  5285. 1)  What were your goals in taking this course?
  5286.  
  5287. ----------------------------------------------------------------------
  5288.  
  5289.  
  5290. 2)  Did you learn anything in this course?  
  5291.  
  5292. ----------------------------------------------------------------------
  5293.  
  5294. 3)  What did you think of the course notes?
  5295.  
  5296. ----------------------------------------------------------------------
  5297.  
  5298. ----------------------------------------------------------------------
  5299.  
  5300. ----------------------------------------------------------------------
  5301.  
  5302. 4)  Did you like the course?
  5303.  
  5304. ----------------------------------------------------------------------
  5305.  
  5306. ----------------------------------------------------------------------
  5307.  
  5308. 5)  What did you think of the instructor?
  5309.  
  5310. ----------------------------------------------------------------------
  5311.  
  5312. ----------------------------------------------------------------------
  5313.  
  5314.  
  5315.  
  5316.  #    #   #####
  5317.                    #     #        #  #      #
  5318.                    #     #####     ##   vi/6/6.1   755   1552     12         617  4453660057   5137 
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.             Writing
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.         o  :w  - basic form of write command
  5339.  
  5340.         o  :y,xw filename
  5341.  
  5342.         o  :y,xw! filename
  5343.  
  5344.         o  :y,xw! !program
  5345.  
  5346.           y refers to the yth line of the file, x to the xth
  5347.         line of the file.  If the file already exists the !
  5348.         right after the w tells vi to overwrite the file.  filename
  5349.         refers to any file while !program means to write the
  5350.         file to the input of the program.
  5351.  
  5352. #   # #
  5353. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  5354. #######    #    #     # #vi/6/6.2   755   1552     12         566  4453660360   5140 
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.  
  5364.  
  5365.             Quit & File Commands
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.         o  :x  - write and quit the vi buffer.
  5377.         o  :wq - write and quit the vi buffer.
  5378.  
  5379.         o  :q  - quit vi.  Will not allow you to quit
  5380.         if any changes have been made to buffer.
  5381.  
  5382.         o  :q! - quit vi regardless of wheter any changes 
  5383.         have made made.
  5384.  
  5385.         o  :f  - print the name of the file & line number
  5386.         where cursor is located.
  5387.  
  5388.  
  5389.  input of the program.
  5390.  
  5391. #   # #
  5392. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  5393. #######    #    #     # #vi/6/6.4   755   1552     12         563  4453660640   5140 
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.             Substitution
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.         o  :xs/RE/re/
  5416.         o  :xs/RE/re/g   - On line x substitute "re" for 
  5417.         "RE".  The g means do it for all lines.
  5418.  
  5419.         o  :1,$s/RE/re/g 
  5420.  
  5421.         As you can see, you can specify a line, lines, or the
  5422.         whole file to change.  Use the g option to make
  5423.         changes throughout the line rather than just the
  5424.         first occurence of a change in the line.
  5425.  
  5426.  
  5427.  
  5428.  input of the program.
  5429.  
  5430. #   # #
  5431. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  5432. #######    #    #     # #vi/6/6.3   755   1552     12         246  4527624612   5136 
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.             Deletion
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.         o  :1d    - deletes first line of file.
  5454.  
  5455.         o  :1,$d - deletes all lines from file.
  5456.  
  5457.         o  :1,5d - deletes lines 1 through 5 of file.
  5458.  
  5459.  
  5460.  
  5461.  
  5462.         As you can see, you can specify a line, lines, or the
  5463.         whole file to change.  Use the g option to make
  5464.         changes throughout the line rather than just the
  5465.         first occurence of a change in the line.
  5466.  
  5467.  
  5468.  
  5469.  input of the program.
  5470.  
  5471. #   # #
  5472. #         # #   #     # #       #     # #     #    #       #    #     # #    ##
  5473. #######    #    #     # #vi/6/6.7   755   1552     12         771  4453661235   5145 
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.             set
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.  
  5492.  
  5493.  
  5494.  
  5495.  
  5496.         o  :set all  - list all parameters
  5497.  
  5498.         o  :set nu
  5499.         o  :set nonu -  Turns on/off numbering for lines
  5500.            in file.
  5501.  
  5502.         o  :set list
  5503.         o  :set nolist - Turns on/off substituting "^I" for
  5504.         the tab character and $ for the (CR).
  5505.  
  5506.         o  :set wm=x  - sets the wrap margin.  If wm is set to
  5507.         0, cursor will not wrap around.  Cursor will wrap x
  5508.         spaces from right margin.
  5509.  
  5510.         o  all these parameters can go into a file called
  5511.         .exrc which will do this for all invocations of vi.
  5512.  
  5513.  
  5514.     # #vi/6/6.0   755   1552     12        1444  4404750570   5151 
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  #####                                                           #####
  5522. #     #  #    #    ##    #####    #####  ######  #####          #     #
  5523. #        #    #   #  #   #    #     #    #       #    #         #
  5524. #        ######  #    #  #    #     #    #####   #    #         ######
  5525. #        #    #  ######  #####      #    #       #####          #     #
  5526. #     #  #    #  #    #  #          #    #       #   #          #     #
  5527.  #####   #    #  #    #  #          #    ######  #    #          #####
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539. ####### #     #
  5540. #        #   #
  5541. #         # #
  5542. #####      #
  5543. #         # #
  5544. #        #   #
  5545. ####### #     #
  5546.  
  5547. #     #
  5548. ##   ##   ####   #####   ######
  5549. # # # #  #    #  #    #  #
  5550. #  #  #  #    #  #    #  #####
  5551. #     #  #    #  #    #  #
  5552. #     #  #    #  #    #  #
  5553. #     #   ####   #####   ######
  5554.  
  5555.  
  5556. ---
  5557.  
  5558. 3)  What did you think of the course notes?
  5559.  
  5560. ----------------------------------------------------------------------
  5561.  
  5562. ----------------------------------------------------------------------
  5563.  
  5564. --------------------------vi/6/6.6   755   1552     12         726  4527624730   5145 
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.  
  5575.  
  5576.             Global Substitions
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.         o  :g/RE/p  - global search and print.
  5588.  
  5589.         o  :g/RE/d  - will delete any line with RE in it.
  5590.  
  5591.         o  :g/RE/s//re will substitute re for RE globally
  5592.         through out the file.
  5593.  
  5594.         o  :g/RE/s/AB/CD/ - will substitute CD for AB
  5595.         wherever RE exists on a line.
  5596.  
  5597.  
  5598.         o  The p option will print to the terminal all lines
  5599.                 where the action was completed.
  5600.  
  5601.         o  v instead of g will do it for all ines that don't
  5602.         match.
  5603.  
  5604.  
  5605.  
  5606.   ######  #    #          #####
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617. vi/6/6.15   755   1552     12        1061  4453660226   5234 
  5618.  
  5619.  
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.             Reading
  5628.  
  5629.  
  5630.  
  5631.  
  5632.  
  5633.  
  5634.  
  5635.  
  5636.  
  5637.  
  5638.         o  :r file  - will read file into the buffer
  5639.                 after the cursor.
  5640.  
  5641.         o  :xr file - will read file into the buffer
  5642.             after line x.
  5643.  
  5644.         o  :r !program - will read into the buffer after the
  5645.         cursor the output of executing program.
  5646.  
  5647.         o  :xr !program - will read into the buffer after
  5648.         line x the output of executing program.
  5649.  
  5650.         o  :x,y! program - will replace lines x through y
  5651.         with the output of executing program with input 
  5652.                 of lines x through y.
  5653.  
  5654.         o  :x,y! fmt - reformat these lines.
  5655.  
  5656.  
  5657. ##      #
  5658. #         # #
  5659. #        #   #
  5660. ####### #     #
  5661.  
  5662. #     #
  5663. ##   ##   ####   #####   ######
  5664. # # # #  #    #  #    #  #
  5665. #  #  #  #    #  #    #  #####
  5666. #     #  #    #  #    #  #
  5667. #     #  #    #  #    #  #
  5668. #     #   ####   #####   ######
  5669.  
  5670.  
  5671. ---
  5672.  
  5673. 3)  What did you think of the course notes?
  5674.  
  5675. ----------------------------------------------------------------------
  5676.  
  5677. ----------------------------------------------------------------------
  5678.  
  5679. --------------------------vi/6/6.5   755   1552     12         623  4453661135   5136 
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.             Shell Escapes
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701.         o  :sh
  5702.  
  5703.         o  :!sh
  5704.  
  5705.         o  :1,5!fmt
  5706.  
  5707.         Both ":sh" and ":!sh" will let you escape to the
  5708.         command processor.  When the shell is exited, control
  5709.         passes back to vi.  The form ":1,5!program" will
  5710.         execute a program with lines 1 through 5 being used as
  5711.         the standard input for the program.  The output of the
  5712.         program will replace lines 1 through 5 in the file.
  5713.  
  5714.  
  5715. replace lines x through y
  5716.         with the output of executing program with input 
  5717.                 of lines x throuvi/6/6.25   755   1552     12         305  4451765764   5230 
  5718.  
  5719.  
  5720.  
  5721.  
  5722.         Editing Multiple Files
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.     
  5734.             o vi file1 file2 file3
  5735.  
  5736.             o :n - will allow you to edit next file
  5737.  
  5738.             o :e  file 
  5739.             o :e! file  - change file to file
  5740.             o :e! %     - start over
  5741.  
  5742.  
  5743.  
  5744.  vi.  The form ":1,5!program" will
  5745.         execute a program with lines 1 through 5 being used as
  5746.         the standard input for the program.  The output of the
  5747.         program will replace lines 1 through 5 in the file.
  5748.  
  5749.  
  5750. replace lines x through y
  5751.         with the output of executing program with input 
  5752.                 of lines x throuvi/6/6.99   644   1552     12        4223  4527625362   5254 
  5753.  
  5754.  
  5755.             Summary Of VI Commands
  5756.         
  5757.                         o  a  - appends after cursor
  5758.                         o  b  - back up a word
  5759.                         o  c  - changes text
  5760.                         o  d  - deletes text
  5761.                         o  e  - forward to end of word
  5762.                         o  h  - 1 space back
  5763.                         o  i  - insert before cursor
  5764.                         o  j  - 1 space down
  5765.                         o  k  - 1 space up
  5766.                         o  l  - 1 space forward
  5767.                         o  o  - Open a line below cursor
  5768.                         o  p  - put text after cursor or line
  5769.                         o  r  - replaces a character
  5770.                         o  u  - undoes last change
  5771.                         o  w  - forward to next word
  5772.                         o  y  - yank text
  5773.  
  5774.  
  5775.                         o  A  - appends at end of line
  5776.                         o  B  - back up a word
  5777.                         o  C  - changes to end of line
  5778.                         o  D  - deletes to end of line
  5779.                         o  E  - forward to end of word
  5780.                         o  G  - last line of file
  5781.                         o  H  - Home or 1st Line
  5782.                         o  I  - insert at beginning of line
  5783.                         o  L  - Last Line
  5784.                         o  J -  join next line with cursor line
  5785.                         o  P -  put text before cursor or line
  5786.                         o  M  - Middle Line
  5787.                         o  O  - Open a line above cursor
  5788.                         o  R  - overwrites text
  5789.                         o  U  - undoes all changes to line
  5790.                         o  W  - forward to next word
  5791.                         o  Y -  yank to end of line
  5792.  
  5793.                         o  CTRL-B - Back a screen
  5794.                         o  CTRL-D - Forward 1/2 screen
  5795.                         o  CTRL-E - scroll window down 1 line
  5796.                         o  CTRL-F - Forward a screen
  5797.                         o  CTRL-G - Displays current info
  5798.                         o  CTRL-U - Back 1/2 screen
  5799.                         o  CTRL-V - insert control characters
  5800.                         o  CTRL-Y - scroll window up 1 line
  5801.  
  5802.  
  5803.          o  c  - changes text
  5804.                         o  d  - deletes text
  5805.                         o  e  - forward to end of word
  5806.                         o  h  - 1 space back
  5807.                         o  i  - insert before cursor
  5808.                         o  j  - 1 space down
  5809.                         o  k  - 1 space up
  5810.                         o  l  - 1 space forward
  5811.  vi/6/6.8   755   1552     12         513  4453661314   5136 
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.             map & ab
  5824.  
  5825.  
  5826.  
  5827.  
  5828.  
  5829.  
  5830.  
  5831.  
  5832.  
  5833.  
  5834.  
  5835.         o  ab chnage change - will change all occurrences of
  5836.         chnage with change when separated by whitespace when
  5837.         input in insert mode.
  5838.  
  5839.         o  map f :f   -  whenever f is hit in command mode
  5840.         will do :f instead of f.  Useful to define
  5841.         cursor keys.
  5842.  
  5843.         o  These can also be put into .exrc file.
  5844.  
  5845.  
  5846.                o  i  - insert before cursor
  5847.                         o  j  - 1 space down
  5848.                         o  k  - 1 space up
  5849.                         o  l  - 1 space forward
  5850.  vi/5/   755   1552     12           0  4553142460   4625 vi/5/5.2   755   1552     12         153  4452472031   5121 
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.             Yanking
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.         o  yw -  yank word
  5871.  
  5872.         o  y$ -  yank to end of line
  5873.  
  5874.         o  yy -  yank line
  5875.  
  5876. nge when separated by whitespace when
  5877.         input in insert mode.
  5878.  
  5879.         o  map f :f   -  whenever f is hit in command mode
  5880.         will do :f instead of f.  Useful to define
  5881.         cursor keys.
  5882.  
  5883.         o  These can also be put into .exrc file.
  5884.  
  5885.  
  5886.                o  i  - insert before cursor
  5887.                         o  j  - 1 space down
  5888.                         o  k  - 1 space up
  5889.                         o  l  - 1 space forward
  5890.  vi/5/5.3   755   1552     12         304  4404747653   5134 
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.  
  5900.             Putting Text
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.         o  puts last text object
  5912.  
  5913.         o  p - puts on next line or next character
  5914.  
  5915.         o  P - put on previous line or previous character
  5916.  
  5917.         o  xp - transposes character
  5918.  
  5919. r f is hit in command mode
  5920.         will do :f instead of f.  Useful to define
  5921.         cursor keys.
  5922.  
  5923.         o  These can also be put into .exrc file.
  5924.  
  5925.  
  5926.                o  i  - insert before cursor
  5927.                         o  j  - 1 space down
  5928.                         o  k  - 1 space up
  5929.                         o  l  - 1 space forward
  5930.  vi/5/5.4   755   1552     12         236  4452472156   5135 
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.             Screen Adjusting
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.         o  CTRL-L -  refresh screen.
  5953.  
  5954.         o  CTRL-E -  Scroll window down 1 line.
  5955.  
  5956.         o  CTRL-Y -  Scroll window up 1 line.
  5957.  
  5958. ter
  5959.  
  5960.         o  xp - transposes character
  5961.  
  5962. r f is hit in command mode
  5963.         will do :f instead of f.  Useful to define
  5964.         cursor keys.
  5965.  
  5966.         o  These can also be put into .exrc file.
  5967.  
  5968.  
  5969.                o  i  - insert before cursor
  5970.                         o  j  - 1 space down
  5971.                         o  k  - 1 space up
  5972.                         o  l  - 1 space forward
  5973.  vi/5/5.5   755   1552     12         353  4452472355   5137 
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.             Misc.
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.         o   J - Joins lines.  The line(s) below the cursor
  5997.             will be appended to the current line.  "2J" is equal
  5998.         to "J". "3J" will join the two line below the
  5999.         current line with the current line.
  6000.  
  6001.  
  6002.  instead of f.  Useful to define
  6003.         cursor keys.
  6004.  
  6005.         o  These can also be put into .exrc file.
  6006.  
  6007.  
  6008.                o  i  - insert before cursor
  6009.                         o  j  - 1 space down
  6010.                         o  k  - 1 space up
  6011.                         o  l  - 1 space forward
  6012.  vi/5/5.0   755   1552     12        2244  4404746773   5160 
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  #####                                                          #######
  6019. #     #  #    #    ##    #####    #####  ######  #####          #
  6020. #        #    #   #  #   #    #     #    #       #    #         #
  6021. #        ######  #    #  #    #     #    #####   #    #         ######
  6022. #        #    #  ######  #####      #    #       #####                #
  6023. #     #  #    #  #    #  #          #    #       #   #          #     #
  6024.  #####   #    #  #    #  #          #    ######  #    #          #####
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036. #######
  6037. #     #   #####  #    #  ######  #####
  6038. #     #     #    #    #  #       #    #
  6039. #     #     #    ######  #####   #    #
  6040. #     #     #    #    #  #       #####
  6041. #     #     #    #    #  #       #   #
  6042. #######     #    #    #  ######  #    #
  6043.  
  6044. #######
  6045. #        #    #  #    #   ####    #####     #     ####   #    #   ####
  6046. #        #    #  ##   #  #    #     #       #    #    #  ##   #  #
  6047. #####    #    #  # #  #  #          #       #    #    #  # #  #   ####
  6048. #        #    #  #  # #  #          #       #    #    #  #  # #       #
  6049. #        #    #  #   ##  #    #     #       #    #    #  #   ##  #    #
  6050. #         ####   #    #   ####      #       #     ####   #    #   ####
  6051.  
  6052.  
  6053. 1st Line
  6054.                         o  I  - insert at beginning of line
  6055.                         o  L  - Last Line
  6056.                         o  J -  join next line with cursor line
  6057.                         o  P -  put text before cursor or line
  6058.                         o  M  - Middle Line
  6059.                         o  O  - Open a line above cursor
  6060.          vi/5/5.1   755   1552     12         345  4453664506   5136 
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.             Searching
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.         o  /string  -  moves cursor to occurence of string
  6080.         pattern.
  6081.  
  6082.         o  ?string  -  searches backward through the buffer
  6083.         for string pattern.
  6084.  
  6085.         o  n -  finds next occurence of the string pattern.
  6086.  
  6087.    #  #    #     #    #####   #    #         ######
  6088. #        #    #  ######  #####      #    #       #####                #
  6089. #     #  #    #  #    #  #          #    #       #   #          #     #
  6090.  #####   #    #  #    #  #          #    ######  #    #          #####
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102. #####vi/5/5.6   755   1552     12         452  4453657651   5145 
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.                 Summary 
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.             o  p - put text after cursor or line.
  6124.             o  y - yank text.
  6125.  
  6126.             o  J - join next line with cursor line.
  6127.             o  P - put text before cursor or line.
  6128.             o  Y - yank to end of line
  6129.  
  6130.             o  CTRL-E -  scroll window down 1 line.
  6131.             o  CTRL-Y -  scroll window up 1 line.
  6132.  
  6133. ######  #####      #    #       #####                #
  6134. #     #  #    #  #    #  #          #    #       #   #          #     #
  6135.  #####   #    #  #    #  #          #    ######  #    #          #####
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147. #####vi/5/5.25   755   1552     12         744  4411760565   5223 
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.             Yanking
  6157.  
  6158.  
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.         o  y(CR) - yank whole line
  6169.         o  y^ - yank from beginning of line to cursor
  6170.  
  6171.         o  yb - yank previous word        ***
  6172.         o  yB - yank previous long word        ***
  6173.  
  6174.         o  ye - yank to end of word
  6175.         o  yE - yank to end of long word
  6176.  
  6177.         o  yW - yank long word            ***
  6178.  
  6179.         o  yH - yank from beginning of window to cursor line
  6180.         o  yM - yank from curor line to middle of screen
  6181.         o  yL - yank from cursor to end of window
  6182.  
  6183.  
  6184.  
  6185.         *** numeric count can be added before command
  6186.  
  6187.       #####
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199. #####vi/5/5.15   755   1552     12         623  4527622764   5224 
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.             Regular Expressions
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.         A Regular Expression is used to specify parts of a
  6215.     line.  It is used in search, substitute, and delete commands.  The
  6216.     concept is also used in many other UNIX commands, to include grep,
  6217.     sed, and jove.
  6218.  
  6219.  
  6220.  
  6221.  
  6222.  
  6223.         o  ^ - beginning of line.
  6224.  
  6225.         o  $ - end of line.
  6226.  
  6227.         o  . - matches any character.
  6228.  
  6229.         o  \ - delimits special characters.
  6230.  
  6231.         o [] - range of characters.
  6232.  
  6233. rom cursor to end of window
  6234.  
  6235.  
  6236.  
  6237.         *** numeric count can be added before command
  6238.  
  6239.       #####
  6240.  
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251. #####vi/README   755   1552     12         625  4452435361   5417     This is the top directory for the vi course.  The following
  6252. files do:
  6253.  
  6254. makevi    -  makes the vi course
  6255. vi    -  the actual vi course
  6256. vi.old    -  the old version of the course
  6257.  
  6258. the following are the chapters:
  6259.  
  6260. head -  Header info
  6261. 1 - introduction
  6262. 2 - navigating (moving around)
  6263. 3 - insert mode
  6264. 4 - changing & deleting text
  6265. 5 - misc
  6266. 6 - Ex mode
  6267.  
  6268.  
  6269.     Dennis Rears drears@pica.army.mil
  6270.  
  6271. LAST CHANGE:  29 June 1989
  6272. m cursor to end of window
  6273.  
  6274.  
  6275.  
  6276.         *** numeric count can be added before command
  6277.  
  6278.       #####
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290. #####vi/5/5.0   755   1552     12        2244  4404746773   5160 
  6291.  
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  #####                                                          #######
  6297. #     #  #    #    ##    #####    #####  ######  #####          #
  6298. #        #    #   #  #   #    #     #    #       #    #         #
  6299. #        ######  #    #  #    #     #    #####   #    #         ######
  6300. #        #    #  ######  #####      #    #       #####                #
  6301. #     #  #    #  #    #  #          #    #       #   #          #     #
  6302.  #####   #    #  #    #  #          #    ######  #    #          #####
  6303.  
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314. #######
  6315. #     #   #####  #    #  ######  #####
  6316. #     #     #    #    #  #       #    #
  6317. #     #     #    ######  #####   #    #
  6318. #     #     #    #    #  #       #####
  6319. #     #     #    #    #  #       #   #
  6320. #######     #    #    #  ######  #    #
  6321.  
  6322. #######
  6323. #        #    #  #    #   ####    #####     #     ####   #    #   ####
  6324. #        #    #  ##   #  #    #     #       #    #    #  ##   #  #
  6325. #####    #    #  # #  #  #          #       #    #    #  # #  #   ####
  6326. #        #    #  #  # #  #          #       #    #    #  #  # #       #
  6327. #        #    #  #   ##  #    #     #       #    #    #  #   ##  #    #
  6328. #         ####   #    #   ####      #       #     ####   #    #   ####
  6329.  
  6330.  
  6331. 1st Line
  6332.                         o  I  - insert at beginning of line
  6333.                         o  L  - Last Line
  6334.                         o  J -  join next line with cursor line
  6335.                         o  P -  put text before cursor or line
  6336.                         o  M  - Middle Line
  6337.                         o  O  - Open a line above cursor
  6338.          J" iline.      #    # 1 spamustmustmm         #    #         toline.      #    # 1 spamustmustmm         #    #         toline.      #    #