home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff197.lzh / Stevie / stevie.doc < prev    next >
Text File  |  1989-03-28  |  15KB  |  522 lines

  1.  
  2.         STEVIE - Simply Try this Editor for VI Enthusiasts
  3.  
  4.              Quick Reference Card
  5.  
  6.                   by
  7.  
  8.               Tony Andrews And G. R. (Fred) Walter
  9.  
  10. STEVIE may be freely distributed. The source isn't copyrighted or
  11. restricted in any way. If you pass the program along, please include all
  12. the documentation and, if practical, the source as well.
  13.  
  14. STEVIE used to stand for 'ST Editor for VI Enthusiasts', however since this
  15. editor is used on more machines than just ST's the acronym was changed.
  16.  
  17. Starting the Editor
  18. -------------------
  19.  
  20. The following command line forms are supported:
  21.  
  22.     vi [file ...]        Edit the specified file(s)
  23.  
  24.     vi -t tag        Start at location of the given tag
  25.  
  26.     vi + file        Edit file starting at end
  27.  
  28.     vi +n file        Edit file starting a line number 'n'
  29.  
  30.     vi +/pat file        Edit file starting at pattern 'pat'
  31.  
  32. If multiple files are given on the command line (using the first form),
  33. the ":n" command goes to the next file, ":p" goes backward in the list,
  34. and ":rew" can be used to rewind back to the start of the file list.
  35.  
  36. Set Command Options
  37. -------------------
  38.  
  39. The ":set" command works as usual to set parameters. Each parameter has
  40. a long and an abbreviated name, either of which may be used. Boolean
  41. parameters are set as in:
  42.  
  43.     set showmatch
  44.  
  45. or cleared by:
  46.  
  47.     set noshowmatch
  48.  
  49. Numeric parameters are set as in:
  50.  
  51.     set scroll=5
  52.  
  53. Several parameters may be set with a single command:
  54.  
  55.     set novb sm report=1
  56.  
  57. To see the status of all parameters use ":set all". Typing ":set" with
  58. no arguments will show only those parameters that have been changed.
  59. The supported parameters, their names, defaults, and descriptions are
  60. shown below:
  61.  
  62. Full Name    Short    Default        Description
  63. ------------------------------------------------------------------------------
  64. vbell        vb    vb        Use visual bell (novb for audible bell)
  65. showmatch    sm    nosm        Showmatch mode
  66. wrapscan    ws    ws        Wrapscan (searches cross file start/end)
  67. errorbells    eb    noeb        Ring bell when error messages are shown
  68. showmode    mo    nomo        Show on status line when in insert mode
  69. backup        bk    nobk        Leave backup in *.bak on file writes
  70. return        cr    cr        End lines with cr-lf when writing
  71. list        list    nolist        Show tabs and newlines graphically
  72. autoindent      ai      noai            Start new line at same col as prior line
  73. ignorecase      ic      noic            Ignore case in search strings
  74. number          nu      nonu            Display lines with their line numbers
  75.  
  76. scroll        scroll    12        Number of lines to scroll for ^D and ^U
  77. tabstop        ts    8        Number of spaces in a tab
  78. report        report    5        Min # of lines to report operations on
  79. lines        lines    25        Number of lines on the screen
  80.  
  81. The EXINIT environment variable can be used to modify the default values
  82. on startup as in:
  83.  
  84.         setenv EXINIT="set sm ts=4"
  85.  
  86. The 'backup' parameter, if set, causes the editor to retain a backup of any
  87. files that are written. During file writes, a backup is always kept for
  88. safety until the write is completed. At that point, the 'backup' parameter
  89. determines whether the backup file is deleted.
  90.  
  91. In environments (e.g. OS/2 or TOS) where lines are normally terminated by
  92. CR-LF, the 'return' parameter allows files to be written with only a LF
  93. terminator (if the parameter is cleared).
  94.  
  95. The 'lines' parameter tells the editor how many lines there are on the screen.
  96. This is useful on systems like the ST where various screen resolutions may be
  97. used. By using the 'lines' parameter, different screen sizes can be easily
  98. handled. On the Amiga system window resizes are atomatically detected and
  99. acted upon. It is suggested that one's window be larger than 2 rows and 5
  100. columns.
  101.  
  102. Colon Commands
  103. --------------
  104.  
  105. Several of the normal 'vi' colon commands are supported by STEVIE. Some commands
  106. may be preceded by a line range specification. For commands that accept a range
  107. of lines, the following address forms are supported:
  108.  
  109. addr
  110. addr + number
  111. addr - number
  112.  
  113. where 'addr' may be one of the following:
  114.     a line number
  115.     a mark (as in 'a or 'b)
  116.     % (entire file)
  117.     . (the current line)
  118.     $ (the last line)
  119.  
  120. The Global Command
  121. ------------------
  122.  
  123. A limited form of the global command is supported, accepting the following
  124. command form:
  125.  
  126. g/pattern/X
  127.  
  128. where X may be either 'd' or 'p' to delete or print lines that match the given
  129. pattern. If a line range is given, only those lines are checked for a match
  130. with the pattern. If no range is given, all lines are checked.
  131.  
  132. If the trailing command character is omitted, 'p' is assumed. In this case, the
  133. trailing slash is also optional. The current version of the editor does not
  134. support the undo operation following the deletion of lines with the global
  135. command.
  136.  
  137. The Substitute Command
  138. ----------------------
  139.  
  140. The substitute command provides a powerful mechanism for making more complex
  141. substitutions than can be done directly from visual mode. The general form of
  142. the command is:
  143.  
  144. s/pattern/replacement/g
  145.  
  146. Each line in the given range (or the current line, if no range was given) is
  147. scanned for the given regular expression. When found, the string that matched
  148. the pattern is replaced with the given replacement string. If the replacement
  149. string is null, each matching pattern string is deleted.
  150.  
  151. The trailing 'g' is optional and, if present, indicates that multiple
  152. occurrences of 'pattern' on a line should all be replaced.
  153.  
  154. Some special sequences are recognized in the replacement string. The
  155. ampersand character is replaced by the entire pattern that was matched.
  156. For example, the following command could be used to put all occurrences
  157. of 'foo' or 'bar' within double quotes:
  158.  
  159. 1,$s/foo|bar/&/g
  160.  
  161. The special sequence "\n" where 'n' is a digit from 1 to 9, is replaced
  162. by the string the matched the corresponding parenthesized expression in
  163. the pattern. The following command could be used to swap the first two
  164. parameters in calls to the C function "foo":
  165.  
  166. 1,$s/foo\\(([^,]*),([^,]*),/foo(\\2,\\1,/g
  167.  
  168. Like the global command, substitutions can't be undone with this version of
  169. the editor.
  170.  
  171. The Delete Command
  172. ------------------
  173.  
  174. :[range]d will delete the range of lines.
  175.  
  176. File Manipulation Commands
  177. --------------------------
  178.  
  179. :w        write the current file
  180. :wq        write and quit
  181. :x        write (if necessary) and quit
  182. ZZ        same as ":x"
  183.  
  184. :e file        edit the named file
  185. :e!        re-edit the current file, discarding any changes
  186. :e #        edit the alternate file
  187.  
  188. :w file        write the buffer to the named file
  189. :x,y w file    write lines x through y to the named file
  190. :r file        read the named file into the buffer
  191.  
  192. :n        edit the next file
  193. :p        edit the previous file
  194. :rew        rewind the file list
  195.  
  196. :f        show the current file name
  197. :f name        change the current file name
  198.  
  199. :ta tag        go to the named tag
  200. ^]        like ":ta" using the current word as the tag
  201.  
  202. :help        display a command summary
  203.  
  204. The ":help" command can also be invoke with the <HELP> key on the Atari ST
  205. or the Amiga. This actually displays a pretty complete summary of the real vi
  206. with unsupported features indicated appropriately.
  207.  
  208. The commands above work pretty much like they do in 'vi'. Most of the
  209. commands support a '!' suffix (if appropriate) to discard any pending
  210. changes.
  211.  
  212. String Searches
  213. ---------------
  214.  
  215. String searches are supported, as in vi, accepting the usual regular
  216. expression syntax. This was done using Henry Spencer's regular expression
  217. library without modification. Tony Andrews added code outside the library to
  218. support the '\<' and '\>' extensions and code inside the library to support
  219. the ignorecase option.
  220.  
  221. Operators
  222. ---------
  223.  
  224. The vi operators (d, c, y, <, and >) work as true operators.
  225.  
  226. Tags
  227. ----
  228.  
  229. Tags are implemented.
  230.  
  231. System-Specific Comments
  232. ------------------------
  233.  
  234. The following sections provide additional relevant information for the
  235. systems to which STEVIE has been ported.
  236.  
  237. Atari ST
  238. --------
  239.  
  240. The editor has been tested in all three resolutions, although low and
  241. high res. are less tested than medium. The 50-line high res. mode can
  242. be used by setting the 'lines' parameter to 50. Alternatively, the
  243. environment variable 'LINES' can be set. The editor doesn't actively
  244. set the number of lines on the screen. It just operates using the number
  245. of lines it was told.
  246.  
  247. The arrow keys, as well as the <INSERT>, <HELP>, and <UNDO> keys are
  248. all mapped appropriately.
  249.  
  250. UNIX
  251. ----
  252.  
  253. The editor has been ported to UNIX System V release 3. This was done
  254. mainly to get some profiling data so I haven't put much effort into
  255. doing the UNIX version right. It's hard-coded for ansi-style escape
  256. sequences and doesn't use the termcap/terminfo routines at all.
  257.  
  258. OS/2
  259. ----
  260.  
  261. This port was done because the editor that comes with the OS/2 developer's
  262. kit really sucks. Make sure 'ansi' mode is on (using the 'ansi' command).
  263. The OS/2 console driver doesn't support insert/delete line, so STEVIE
  264. bypasses the driver and makes the appropriate system calls directly.
  265. This is all done in the system-specific part of the editor so the kludge
  266. is at least localized.
  267.  
  268. The arrow keys, page up/down and home/end all do what you'd expect. The function
  269. keys are hard-coded to some useful macros until I can get true support for
  270. macros into the editor. The current mappings are:
  271.  
  272. F1    :p <RETURN>
  273. F2    :n <RETURN>
  274. F3    :e # <RETURN>
  275. F4    :rew <RETURN>
  276. F5    [[
  277. F6    ]]
  278. F7    <<
  279. F8    >>
  280. F9    :x <RETURN>
  281. F10    :help <RETURN>
  282.  
  283. S-F1    :p! <RETURN>
  284. S-F2    :n! <RETURN>
  285.  
  286. MSDOS
  287. -----
  288.  
  289. STEVIE has been ported to MSDOS 3.3 on an AT using the Microsoft C compiler,
  290. version 5.10.  The keyboard mappings are the same as for OS/2.
  291. The only problem with the PC version is that the inefficiency of
  292. the screen update code becomes painfully apparent on slower machines.
  293.  
  294. BSD 4.3
  295. -------
  296.  
  297. This port was done so it could be worked on in a main-frame enviroment.
  298.  
  299. Amiga
  300. -----
  301.  
  302. The arrow keys and the help key are supported, as is window re-sizing.
  303. It is strongly suggested that you not try to type in console commands
  304. (alt-esc in some keymaps, plus the appropriate other keys) since STEVIE
  305. captures all console input. If you do type alt-esc then typing '|' will
  306. return you to STEVIE.
  307.  
  308. Missing Features
  309. ----------------
  310.  
  311. 1. Macros with support for function keys.
  312.  
  313. 2. More "set" options.
  314.  
  315. 3. Many others...
  316.  
  317. Known Bugs and Problems
  318. -----------------------
  319.  
  320. 1. The yank buffer uses statically allocated memory, so yanks of more than
  321.    5K of text will fail. If a delete spans more than 5K, the program asks
  322.    for confirmation before proceeding. That way, if you were moving text,
  323.    you don't get screwed by the limited yank buffer. You just have to move
  324.    smaller chunks at a time. All the internal buffers (yank, redo, etc.)
  325.    need to be reworked to allocate memory dynamically.
  326.  
  327. 2. If you stay in insert mode for a long time (around 5K's worth of
  328.    characters, including newlines) the insert buffer can overflow.
  329.    When this happens you lose your ability to automatically undo the text just
  330.    inserted and the redo/undo/(undo of undo) buffers are reset to the
  331.    current position.
  332.  
  333. 3. Several other less bothersome glitches...
  334.  
  335. Character Function Summary
  336. --------------------------
  337.  
  338. The following list describes the meaning of each character that's used
  339. by the editor. In some cases characters have meaning in both command and
  340. insert mode; these are all described.
  341.  
  342. ^@    The null character. Not used in any mode. This character may not
  343.     be present in the file, as is the case with vi.
  344.  
  345. ^B    Backward one screen.
  346.  
  347. ^D    Scroll the window down one half screen.
  348.  
  349. ^E    Scroll the screen up one line.
  350.  
  351. ^F    Forward one screen.
  352.  
  353. ^G    Same as ":f" command. Displays file information.
  354.  
  355. ^H (BS)    Moves cursor left one space in command mode. In insert mode, erases
  356.     the last character typed.
  357.  
  358. ^J    Move the cursor down one line.
  359.  
  360. ^L    Clear and redraw the screen.
  361.  
  362. ^M (CR)    Move to the first non-white character in the next line. In insert
  363.     mode, a carriage return opens a new line for input.
  364.  
  365. ^N    Move the cursor down a line.
  366.  
  367. ^P    Move the cursor up a line.
  368.  
  369. ^U    Scroll the window up one half screen.
  370.  
  371. ^V    Indicates that the next character is should be treated as entered
  372.     and not modified (used to enter control characters, etc.).
  373.  
  374. ^Y    Scroll the screen down one line.
  375.  
  376. ^[    Escape cancels a pending command in command mode, and is used to
  377.     terminate insert mode.
  378.  
  379. ^]    Moves to the tag whose name is given by the word in which the cursor
  380.     resides.
  381.  
  382. ^`    Same as ":e #" if supported (system-dependent).
  383.  
  384. SPACE    Move the cursor right on column.
  385.  
  386. $    Move to the end of the current line.
  387.  
  388. %    If the cursor rests on a paren '()', brace '{}', or bracket '[]',
  389.     move to the matching one.
  390.  
  391. '    Used to move the cursor to a previously marked position, as in
  392.     'a or 'b. The cursor moves to the start of the marked line. The
  393.     special mark '' refers to the "previous context".
  394.  
  395. +    Same as carriage return, in command mode.
  396.  
  397. ,    Reverse of the last t, T, f, or F command.
  398.  
  399. -    Move to the first non-white character in the previous line.
  400.  
  401. .    Repeat the last edit command.
  402.  
  403. /    Start of a forward string search command. String searches may be
  404.     optionally terminated with a closing slash. To search for a slash
  405.     use '\/' in the search string.
  406.  
  407. 0    Move to the start of the current line. Also used within counts.
  408.  
  409. 1-9    Used to add 'count' prefixes to commands.
  410.  
  411. :    Prefix character for "ex" commands.
  412.  
  413. ;    Repeat last t, T, f, or F command.
  414.  
  415. <    The 'left shift' operator.
  416.  
  417. >    The 'right shift' operator.
  418.  
  419. ?    Same as '/', but search backward.
  420.  
  421. A    Append at the end of the current line.
  422.  
  423. B    Backward one blank-delimited word.
  424.  
  425. C    Change the rest of the current line.
  426.  
  427. D    Delete the rest of the current line.
  428.  
  429. E    End of the end of a blank-delimited word.
  430.  
  431. F    Find a character backward on the current line.
  432.  
  433. G    Go to the given line number (end of file, by default).
  434.  
  435. H    Move to the first non-white char. on the top screen line.
  436.  
  437. I    Insert before the first non-white char. on the current line.
  438.  
  439. J    Join two lines.
  440.  
  441. L    Move to the first non-white char. on the bottom screen line.
  442.  
  443. M    Move to the first non-white char. on the middle screen line.
  444.  
  445. N    Reverse the last string search.
  446.  
  447. O    Open a new line above the current line, and start inserting.
  448.  
  449. P    Put the yank/delete buffer before the current cursor position.
  450.  
  451. T    Reverse search 'upto' the given character.
  452.  
  453. W    Move forward one blank-delimited word.
  454.  
  455. X    Delete one character before the cursor.
  456.  
  457. Y    Yank the current line. Same as 'yy'.
  458.  
  459. ZZ    Exit from the editor, saving changes if necessary.
  460.  
  461. [[    Move backward one C function.
  462.  
  463. ]]    Move forward one C function.
  464.  
  465. ^    Move to the first non-white on the current line.
  466.  
  467. `    Move to the given mark, as with '. The distinction between the two
  468.     commands is important when used with operators. I support the
  469.     difference correctly. If you don't know what I'm talking about,
  470.     don't worry, it won't matter to you.
  471.  
  472. ~       Switch case of character under cursor.
  473.  
  474. a    Append text after the cursor.
  475.  
  476. b    Back one word.
  477.  
  478. c    The change operator.
  479.  
  480. d    The delete operator.
  481.  
  482. e    Move to the end of a word.
  483.  
  484. f    Find a character on the current line.
  485.  
  486. h    Move left one column.
  487.  
  488. i    Insert text before the cursor.
  489.  
  490. j    Move down one line.
  491.  
  492. k    Move up one line.
  493.  
  494. l    Move right one column.
  495.  
  496. m    Set a mark at the current position (e.g. ma or mb).
  497.  
  498. n    Repeat the last string search.
  499.  
  500. o    Open a new line and start inserting text.
  501.  
  502. p    Put the yank/delete buffer after the cursor.
  503.  
  504. r    Replace a character.
  505.  
  506. s    Replace characters.
  507.  
  508. t    Move forward 'upto' the given character on the current line.
  509.  
  510. u    Undo the last edit.
  511.  
  512. w    Move forward one word.
  513.  
  514. x    Delete the character under the cursor.
  515.  
  516. y    The yank operator.
  517.  
  518. z    Redraw the screen with the current line at the top (zRETURN),
  519.     the middle (z.), or the bottom (z-).
  520.  
  521. |    Move to the column given by the preceding count.
  522.