home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / unix_c / info / vi_ref.txt < prev    next >
Encoding:
Text File  |  1989-03-21  |  3.5 KB  |  117 lines

  1.  
  2. ================ vi.n === (first page of quick intro) =========
  3.     QUICK INTRODUCTION TO THE vi VIDEO EDITOR
  4.  
  5. ENTERING vi
  6.  
  7.     vi name        start vi editor with file   name   .
  8.             The file is created if it doesn't exist.
  9.  
  10. LEAVING vi
  11.  
  12.     ZZ        exit from vi, saving changes.
  13.     :q!        exit from vi, discarding changes.
  14.  
  15. CURSOR POSITIONING
  16.  
  17.     h        moves left one character position.
  18.     j        moves down one line.
  19.     k        moves up one line.
  20.     l        moves right one character position.
  21.              NOTE: On the adm3a video terminal keyboard, these
  22.               letters have arrows above them which correspond
  23.               to the direction of the cursor movement.
  24.     0    (zero)    moves to the beginning of a line.
  25.     w        moves right one word.
  26.     b        moves left one word.
  27.     CTRL-u        moves up 1/2 screen full.
  28.     CTRL-d        moves down 1/2 screen full.
  29.     G        moves to the bottom of the file.
  30.     nG        moves to line number   n   .
  31.     CTRL-l        clear screen and re-draw.
  32.  
  33. TEXT MODIFICATION
  34.  
  35.     itextESC    inserts   text   to the left of the cursor.
  36.              Insert doesn't cause the cursor to move;  text
  37.              appears as it is typed, terminate with ESC.
  38.     atextESC    appends  (inserts)   text   to the right of the
  39.              cursor, terminate with ESC.
  40.     RtextESC    Replaces (overprints) characters at the cursor
  41.              position, terminate with ESC.
  42.     dd        deletes the line the cursor is on.
  43.     ndd        deletes   n   lines from the cursor position.
  44.              NOTE: Deleted lines are replaced with the character
  45.                @   which is removed when the page is re-drawn.
  46.     D        deletes characters from the cursor position to the
  47.              end of the line.
  48.     x        deletes the character at the cursor.
  49.     nx        deletes   n   characters to the right of the
  50.              cursor.
  51.     u        undo the last change.
  52.  
  53. PATTERN SEARCHING
  54.  
  55.     /pat/        positions the cursor at the next occurrence
  56.              of the string   pat   .
  57.  
  58. NOTES:
  59.     ESC    represents the ESC key.  Press the ESC key when it is
  60.         called for in the above commands.
  61.     CTRL-    represents the CTRL key.  Hold the CTRL key and press the
  62.         following key simultaneously.
  63.  
  64. ================ via.n ==== (second page of vi quick intro) ==========
  65.     SECOND LEVEL vi EDITING COMMANDS
  66.  
  67. CURSOR POSITIONING
  68.  
  69.     }        move down one paragraph.
  70.     {        move up one paragraph.
  71.     mx        save the current cursor position and label it
  72.             with the letter x. (x is any letter)
  73.     'x        return to the cursor position labeled x.
  74.  
  75. TEXT MODIFICATION
  76.  
  77.     dw        delete the next word.
  78.     .      (period) repeat last change.
  79.     A        append at the end of the current line.
  80.     P        put back deleted line(s).  Text deleted with D
  81.             and dd commands may be pasted back with the P
  82.             command.  Text is pasted in before the cursor
  83.             position.
  84.     :a,bs/old/new/    From line number 'a' to line number 'b', substitute
  85.             the pattern 'old' with the pattern 'new'.  You
  86.             may use any text string which doesn't contain a
  87.             carriage return in place of the 'old' and 'new' 
  88.             strings.  Use CTRL-G to tell what line the cursor is
  89.             on.
  90. PATTERN SEARCHING
  91.  
  92.     //        search for the next occurrence of a previously
  93.             specified search string.  
  94.  
  95. MISCELLANEOUS
  96.  
  97.     :w        write out current changes.  The vi editor works
  98.             on a copy of your file.  The :w command causes
  99.             the editor to write its copy over the original
  100.             which is on the disk.
  101.     :w name        write out changes to the file  name  .  This is
  102.             like the :w command but the changes are written
  103.             into the file you specify.  (good for making
  104.             intermediate copies)
  105. Cut and Paste        Move to the begining of the text to cut.  Use dd
  106.             to delete (cut) several lines.  Use D to cut only
  107.             the end of one line.  Move to the place where you
  108.             wish to paste the text.  Use P to put back the text.
  109.             You may need to clean up the spacing after pasting.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.