home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 144.lha / avi.doc < prev    next >
Text File  |  1986-11-20  |  9KB  |  275 lines

  1.                 AVI 1.0
  2.  
  3. The program avi is a workalike version of UN*X vi for the Amiga. It is
  4. intended to provide vi users, who tend to be a rather hardcore lot, with
  5. their favorite text editor. Version 1.0 implements only a subset of 
  6. standard vi, has a few intentional changes, and many (minor) unintentional
  7. changes.  I have used it extensively and have 97% confidence in its
  8. suitability for intended use.  Nevertheless, users should be aware that
  9. it has not been tested in a variety of configurations and due care should
  10. be exercised when editting important files.
  11.  
  12. Avi is not a user-friendly program.  The following summary is not intended
  13. to supplant the published tutorials and user guides for vi.  It will
  14. point out the implemented features and differences of avi, and provide
  15. a refresher for experienced users.
  16.  
  17. Even the most experienced users should read the section on searching
  18. and replacement, as their are many (intentional) changes there.
  19.  
  20. Modes:
  21.     Avi has two modes of operation: command mode and input mode.
  22.     You can tell which mode the program is in by the color of the
  23.     cursor. With the default preference pallete, an orange
  24.     cursor indicates command mode and a white cursor indicates
  25.     input mode.  In command mode, keystrokes are interpreted as
  26.     commands.  In input mode, keystrokes are entered into the file.
  27.     Command mode is entered by issuing one of the input commands
  28.     listed below.  Input mode is ended by typing ESC.
  29.  
  30.     Autoindent mode (see below) is useful when writing programs.
  31.     When in insert mode, each new line is indented as far as
  32.     the previous one.  Note that in autoindent mode, the leading
  33.     white space is rewritten using the fewest number of spaces
  34.     and tabs needed to accomplish this indentation, and in
  35.     particular lines containing only white space are completely
  36.     truncated.
  37.  
  38.     NB: There is no notion of ^T, i.e. software tabs.  ^T enters
  39.         a tab character.
  40.  
  41.  
  42. Commands:
  43.  
  44.     Counts before commands repeat their effect.
  45.     Operators are followed by a cursor motion to limit
  46.     their range.  Stuttered operators (e.g. dd) limit
  47.     the range to the current line (e.g. dd deletes the
  48.     current line).
  49.  
  50. File commands:
  51.  
  52.     The only file commands implemented are
  53.     :wCR  -- write to the editted file
  54.     :qCR  -- exit the program
  55.     :q!CR -- exit the program, discard changes.
  56.     ^G    -- show line number
  57.  
  58. Positioning commands:
  59.  
  60.     ^F    -- forward one screenful
  61.     ^B    -- backward one screenful
  62.     ^D    -- scroll down 1/2 screenful
  63.     ^U    -- scroll up 1/2 screenful
  64.     ^L    -- redraw screen
  65.  
  66. Cursor motion:
  67.  
  68.     CR    -- first non-white on next line
  69.     +     -- first non-white on next line
  70.     -     -- first non-white on previous line
  71.     ^     -- first non-white on same line
  72.     0     -- first character on same line
  73.     ng    -- goto n'th line
  74.     G     -- goto last line
  75.  
  76.     j     -- next line, same column (also up arrow)
  77.     k     -- previous line, same column (also down arrow)
  78.     h     -- previous character (also left arrow, ^H)
  79.     i     -- next character (also right arrow, SPACE)
  80.  
  81.     w     -- forward one word
  82.     W     -- forward one blank delimited word
  83.     b     -- backward one word
  84.     B     -- backward one blank delimited word
  85.     fx    -- find character x forward
  86.     tx    -- to character before x
  87.     F     -- find character x backward
  88.     T     -- to character x backward
  89.     ;     -- repeat last f t F T
  90.     ,     -- repeat last f t F T in opposite direction
  91.     %     -- find matching (), [], or {}
  92.  
  93. Operators:
  94.     d     -- delete
  95.     c     -- change, enter input mode overwriting
  96.          the characters indicated by the cursor
  97.          motion, then insert characters.
  98.     y     -- yank to buffer
  99.     <     -- shift left
  100.     >     -- shift right
  101.  
  102. Yank, Put, and buffers.
  103.     The yank operator yanks characters from the text
  104.     and puts them into a buffer.  The buffer may be
  105.     specified by prefixing with a "x where x is an
  106.     alphabetic buffer name.  Hence "ay+ yanks the
  107.     current line and the next line to the buffer a
  108.     "ap puts the contents of buffer a after the cursor.
  109.     Delete also puts the deleted text into a buffer, and
  110.     may be used with a named buffer.  Hence "add deletes
  111.     the current line and puts it into buffer a.  If a
  112.     buffer is not specified, it goes into the numbered
  113.     buffer 1.  The numbered buffers are rolled on each
  114.     yank and delete.  Hence 1 contains the last text
  115.     yanked or deleted, 2 contains the next to last text,
  116.     and so on, up to buffer 9.  
  117.  
  118.     p      -- put most recently yanked text after cursor
  119.     P      -- put most recently yanked text before cursor
  120.     "xp    -- put text from buffer x
  121.     "xP    -- put text from buffer x
  122.     "xy    -- yank text to buffer x
  123.  
  124. Undo and repeat:
  125.     u      -- undo the last change
  126.     .      -- repeat the last change
  127.  
  128. Input mode:
  129.     r      -- replace character under cursor
  130.     a      -- append characters after cursor
  131.     i      -- insert characters befor cursor
  132.     A      -- append at end of line
  133.     I      -- insert before first non-white
  134.     o      -- open line below
  135.     O      -- open line above
  136.     ^H     -- backspace, erase last character entered
  137.     ^D     -- same as ^H
  138.     ^W     -- erase last word entered
  139.     ^X     -- erase all input entered
  140.     ESC    -- end input mode
  141.  
  142. Abbreviations and join:
  143.     C      -- change to end of line (c$)
  144.     D      -- delete to end of line (d$)
  145.     s      -- substitute (cl)
  146.     x      -- delete character (dl)
  147.     X      -- delete character before cursor (dh)
  148.     Y      -- yank lines (yy)
  149.     J      -- join next line with current line
  150.  
  151. Mark and return:
  152.     mx     -- mark current location as x.
  153.     'x     -- goto first non-white in line with mark x.
  154.     `x     -- goto mark x.
  155.     ''     -- not supported.
  156.  
  157. Search and replace:
  158.     /pat   -- search forward for pat
  159.     ?pat   -- search backward for pat
  160.     n      -- search in same direction for same pat
  161.     N      -- search in opposite direction for same pat
  162.     :s/pat/rpat -- replace all occurances of pat with rpat
  163.            (NOTE: selective search and replace is accomplished
  164.               with judicious use of search, change and
  165.               redo commands.)
  166.  
  167. NB: / finds the first occurance of pat starting from the line after
  168.     the current one.  ? does the same except it starts from the
  169.     previous line.  N and n, when searching backwards, do the same.
  170.     However N and n, when searching forwards, starts from the current
  171.     cursor position.  This last is an intentional deviation from
  172.     the vi practice.  I put it in to facilitate selective replacement
  173.     using n and . commands.
  174.  
  175. The search and replace commands are different from vi standards.  First,
  176. :s is a global search and replace.  No line addressing here.  Second,
  177. the patterns are based on the Amiga pattern syntax, e.g. #, ?, |, etc.
  178. Also included are character classes using [].
  179.  
  180. NB: PATTERN CHARACTERS ARE ENTERED USING ALT-X TO ENTER THE PATTERN
  181.     METACHAR X.  THIS WILL ECHO IN ORANGE TO HIGHLIGHT IT'S METACHAR
  182.     NATURE.  THE ALT- IS SUPPRESSED IN THE INTEREST OF READABILITY
  183.     IN THE NEXT SECTION.
  184.  
  185. A summary of the pattern metacharacters is:
  186.  
  187.     #pat      -- 0 or more occurances of pat.
  188.     ?         -- any character.
  189.     %      -- null string.
  190.     p|q       -- matches patterns matching pattern p or pattern q.
  191.     (pat)     -- for grouping patterns.
  192.     [string]  -- matches any character in string.
  193.     [a-z]     -- matches any character between a and z inclusive.
  194.              according to the ascii collating sequence.
  195.     [^string] -- matches any character not in string.
  196.     [^a-z]    -- matches any character not between a and z inclusive.
  197.     
  198.  
  199. Parenthesis, in addition to their use in grouping, also identify
  200. parts of the matched pattern useful in replacement.  The entire
  201. string matched is denoted by \0.  The string matched by the first
  202. parenthesized subpattern by \1, etc. For example:
  203.  
  204.     :s/a|an/xxx\0xxx
  205.  
  206.     would change "this is an outrage" to "this is xxxanxxx outrxxxaxxxge"
  207.  
  208.     and
  209.  
  210.     :s/([abc])([efg])/\2\1
  211.  
  212.     would change "af xx bg xx ce" to "fa xx gf xx ec"
  213.  
  214. Parenthesized subexpressions which are one alternative in an or expression
  215. have an undefined value if that alternative is not taken.  Never use
  216. them in a replacement pattern.
  217.  
  218. For example :s/(abc)|(def)/\1 is useless.
  219. but         :s/abc(e|f)gh)/\1 is fine.
  220.  
  221.  
  222.  
  223. Sets:
  224.  
  225.     :set      -- display current settings
  226.     :set ws   -- set wrapscan on
  227.     :set ai   -- set autoindent on
  228.     :set ic   -- set ignore case for searches on
  229.     :set nows -- set wrapscan off
  230.     :set noai -- set autoindent off
  231.     :set noic -- set ignore case for searches off
  232.     :set numb -- set tabsize
  233.  
  234.     More than one flag may be specified in a set command.
  235.  
  236.     Wrapscan means wrap around the top and bottom of the
  237.     file when searching.
  238.  
  239.     Autoindent is explained above unders modes.
  240.  
  241.     Ignore case ignores the case of alphabetic characters
  242.     during searches.  Ignore case is ignored inside of
  243.     character class specifications.
  244.  
  245.     Tabsize has the obvious meaning.  It is also the size
  246.     used for <, > (the shiftwidth of vi).  In avi, hard tabs (\t)
  247.     and software tabs (^T)  are confounded.
  248.  
  249.     The default setting is "nows noai ic 8"
  250.  
  251.  
  252. Caveats:
  253.     Avi eats memory.  It will die a horrible death if starved.
  254.     Do not use with less than 150K or so of free memory.  But
  255.     if you have enough memory to run alink, you have enough
  256.     for avi.
  257.  
  258.     Avi has been known to die mysteriously when used
  259.     with BlitzFonts.
  260.  
  261.     Avi only understands the default 80 character font.
  262.  
  263.     Very occaisionally, after an undo, the screen display
  264.     is improper.  ^L fixes this.
  265.  
  266.     Avi is limited to editting files of 4000 lines or fewer,
  267.     and refuses to edit files with lines longer than 256.
  268.     It does not wrap long lines or provide horizontal
  269.     scrolling.
  270.  
  271.     Bug reports, complaints, and suggestions may be sent to:
  272.  
  273.     Peter Nestor
  274.     Compuserve 70721,2335
  275.