home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / E2.ZIP / E_REF < prev    next >
Text File  |  1991-02-04  |  17KB  |  646 lines

  1.               USING THE RAND EDITOR E
  2.  
  3.                   Mike O'Carroll
  4.  
  5.                              Microsystems Unit
  6.                             University of Leeds
  7.  
  8.  
  9.  
  10. 1.  INTRODUCTION
  11.  
  12. This quick-reference manual assumes that you are familiar  with  the  basic
  13. operation  of  ned,  an  earlier version of e.  If not, well, it's not that
  14. difficult, anyway.
  15.  
  16. The editor may be used on any Lear Siegler type terminal (adm3a,  adm5)  or
  17. equivalent.  An  IBM PC running uc has its keyboard programmed on start up;
  18. the equivalent keys are indicated in column 3 below.
  19.  
  20. 2.  NOTATION
  21.  
  22. The sequence ^X means control-X, <NAME> means the key called NAME and N  is
  23. an  integer.   (CV),  (CH) and (CVH) mean vertical, horizontal and diagonal
  24. cursor move sequences respectively.  <CMD> will normally  be  the  <ESCAPE>
  25. key.
  26.  
  27. The term close means that text is deleted and the space is closed up, while
  28. erase  means  that  the deletion is replaced by white space.  References to
  29. this file or current file mean the file which is in the active window indi-
  30. cated by solid borders.
  31.  
  32. 3.  CURSOR MOVEMENT
  33.  
  34.     cursor down                       @south@
  35.     cursor up                         @north@
  36.     cursor right                      @east@
  37.     cursor left                       @west@
  38.     cursor to top LH corner (home)    <HOME>          <Home>
  39.     cursor to bottom LH corner (end)  <CMD><HOME>     <End>
  40.     cursor to last line               <CMD>@south@
  41.     cursor to first line              <CMD>@north@
  42.     cursor to end of line             <CMD>@east@
  43.     cursor to beginning of line       <CMD>@west@
  44.     tab right                         <TAB>           @east@|
  45.     tab left                          ^]              |@west@
  46.  
  47.  
  48. 4.  ENDING THE EDIT
  49.  
  50.     exit and save all touched files   ^Z
  51.     abort but save keystrokes         ^E^Z
  52.  
  53. Other methods of exiting are described under the EXIT heading.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                                    - 2 -
  68.  
  69.  
  70. 5.  WINDOW MOVEMENT
  71.  
  72.     down one page                     ^V              <PgDn>
  73.     up one page                       ^G              <PgUp>
  74.     down 10 lines                     ^D
  75.     up 10 lines                       ^U
  76.     down N pages                      <CMD>N^V
  77.     up N pages                        <CMD>N^G
  78.     down N lines                      <CMD>N^D
  79.     up N lines                        <CMD>N^U
  80.     down, put current line at top     <CMD>^D
  81.     up, put current line at bottom    <CMD>^U
  82.     down to end of file               <CMD>^V
  83.     up to top of file                 <CMD>^G
  84.     right 16 columns                  ^R
  85.     left 16 columns                   ^X
  86.     right N columns                   <CMD>N^R
  87.     left N columns                    <CMD>N^X
  88.     right, put current column at left <CMD>^R
  89.     left, put current column at right <CMD>^X
  90.     mark first cursor position        ^B              <F3>
  91.     mark second position, goto first  ^B
  92.     remove marks                      <CMD>^B         <F6>
  93.  
  94. Note that any attempt to move the cursor beyond a window  edge  will  cause
  95. the  window  to shift in the appropriate direction.  WARNING: marks delimit
  96. the active area for block edit functions (qv).
  97.  
  98. 6.  CHARACTER EDITING
  99.  
  100.     toggle insert/overwrite mode      ^O              <Ins>
  101.     erase/close character to left     <RUB>
  102.     close character to right          ^N              <Del>
  103.     erase all chars to right          <CMD>^N
  104.     erase/close all chars to left     <CMD><RUB>
  105.  
  106. In insert mode, <RUB> closes, otherwise it erases.
  107.  
  108. 7.  LINE EDITING
  109.  
  110.     insert blank line above current   ^_              <F1>
  111.     delete current line               ^Y              <F2>
  112.     erase current line                ^E^Y            <Ctrl-F2>
  113.     split current line at cursor      ^E^             <Alt-F1>
  114.     join next line to current         ^E@south@       <Alt-F2>
  115.  
  116. See also the block editing functions.
  117.  
  118. 8.  STRING SEARCHES
  119.  
  120.     search down for string            <CMD>string^F
  121.     search up for string              <CMD>string^T
  122.     search down for word at cursor    <CMD>^F
  123.     search up for word at cursor      <CMD>^T
  124.     repeat search down/up             ^F/^T           <F9>/<F10>
  125.     do current replacement (qv)       ^E^E
  126.     do current, search for next       ^E^F            <Alt-F9>
  127.     do current, search for previous   ^E^T            <Alt-F10>
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                                    - 3 -
  140.  
  141.  
  142. 9.  BLOCK EDITING
  143.  
  144. Block moves are achieved using the close, erase and pick  buffers;  use  of
  145. the last allows copying of text.
  146.  
  147.     insert a blank line               ^_              <F1>
  148.     insert N blank lines              <CMD>N^_
  149.     insert several blank lines        ^B(CV)^_
  150.     insert a blank block              ^B(CVH)^_
  151.     pick up current line              ^A              <F4>
  152.     pick up N lines                   <CMD>N^A
  153.     pick up several lines             ^B(CV)^A
  154.     pick up several columns           ^B(CH)^A
  155.     pick up a rectangular block       ^B(CVH)^A
  156.     put down last picked block        <CMD>^A         <F5>
  157.     close current line                ^Y              <F2>
  158.     close N lines                     <CMD>N^Y
  159.     close several lines               ^B(CV)^Y
  160.     close several columns             ^B(CH)^Y
  161.     close a rectangular block         ^B(CVH)^Y
  162.     put down last closed block        <CMD>^Y         <F7>
  163.     erase current line                ^E^Y            <Ctrl-F2>
  164.     erase N lines                     <CMD>N^E^Y
  165.     erase several lines               ^B(CV)^E^Y
  166.     erase several columns             ^B(CH)^E^Y
  167.     erase a rectangular block         ^B(CVH)^E^Y
  168.     put down last erased block        <CMD>^E^Y       <Ctrl-F7>
  169.     close next word                   ^E^N
  170.     put down last closed word         <CMD>^E^N
  171.  
  172.  
  173. 10.  MISCELLANEOUS
  174.  
  175.     set a tab stop at cursor          ^@at@              use TAB
  176.     remove the tab stop at cursor     <CMD>^@at@         command
  177.     remove all tabs                   ^E^@at@            below
  178.     redraw a clean screen             ^E<HOME>        <Ctrl-Home>
  179.     interrupt search or replace (qv)  ^C
  180.     switch to next window (qv)        ^W              <Alt-F8>
  181.         put alternate file (qv) in
  182.         current window                ^E^W            <F8>
  183.     recall previous command string    ^E^A            <Alt-F5>
  184.  
  185.  
  186.  
  187. 11.  INTERNAL COMMANDS
  188.  
  189. These are built-in commands which require  a  combination  of  control  and
  190. printing  characters;  they  are  always given on the command line. Some of
  191. them duplicate functions described above.
  192.  
  193. 11.1.  BOX
  194.  
  195.     draw a box                        ^B(CVH)<CMD>box<CR>
  196.  
  197. If (CVH) is (CH) only, a horizontal line will be drawn.  To draw a vertical
  198. line, make (CVH) such that (CH) moves one column only.
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                                    - 4 -
  212.  
  213.  
  214. 11.2.  CENTRE
  215.  
  216.     centre current line               <CMD>cen<CR>
  217.     centre N lines                    <CMD>N cen<CR>
  218.     centre several lines              ^B(CV)<CMD>cen<CR>
  219.     insert original text              <CMD>ins a<CR>
  220.  
  221. The width (default 74) for centering, filling and justifying may be changed
  222. using SET.
  223.  
  224. 11.3.  CLOSE
  225.  
  226.     close current line                <CMD>clo<CR>
  227.     close N lines                     <CMD>clo N<CR>
  228.     close a block                     ^B(CVH)<CMD>clo<CR>
  229.     restore last closure              <CMD>-clo<CR>
  230.  
  231.  
  232. 11.4.  COMMAND MODE
  233.  
  234.     enter command mode                <CMD>com<CR>
  235.     leave command mode                <CMD>-com<CR>
  236.  
  237.  
  238. 11.5.  COVER
  239.  
  240. Normally, when text blocks are put down, existing material is  pushed  down
  241. (for  vertical  blocks) or sideways (for horizontal or rectangular blocks).
  242. This command causes the dropped text to overwrite what is there.
  243.  
  244.     cover with pick buffer            <CMD>cov p<CR>
  245.     cover with close buffer           <CMD>cov c<CR>
  246.     cover with erase buffer           <CMD>cov e<CR>
  247.  
  248.  
  249. 11.6.  DELETE
  250.  
  251.     delete current file (permanently) <CMD>del<CR>
  252.  
  253.  
  254. 11.7.  EDIT
  255.  
  256.     edit another file in this window  <CMD>e altfile<CR>
  257.     switch to alternate file (if any) <CMD>e<CR>
  258.  
  259.  
  260. 11.8.  ERASE
  261.  
  262.     erase current line                <CMD>era<CR>
  263.     erase N lines                     <CMD>era N<CR>
  264.     erase a block                     ^B(CVH)<CMD>era<CR>
  265.     put back last erasure             <CMD>-era<CR>
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.                                    - 5 -
  284.  
  285.  
  286. 11.9.  EXIT
  287.  
  288.     exit: save file and state         <CMD>ex<CR>
  289.     nosave: save state but not file   <CMD>ex n<CR>
  290.     quit: don't save state or file    <CMD>ex q<CR>
  291.     abort: save keystrokes for replay <CMD>ex a<CR>
  292.  
  293. On a normal exit, all files which have been modified during  the  edit  are
  294. updated;  however,  it is possible to save files selectively by turning off
  295. the default setting - see the internal UPDATE command below.
  296.  
  297. 11.10.  FILL
  298.  
  299.     fill text to end of paragraph     <CMD>fil<CR>
  300.     fill next N paragraphs            <CMD>fil Np<CR>
  301.     fill next N lines                 <CMD>fil Nl<CR>
  302.     insert original text              <CMD>ins a<CR>
  303.  
  304.  
  305. 11.11.  GOTO
  306.  
  307.     goto start of file                <CMD>go<CR>
  308.     goto line number N                <CMD>go N<CR>
  309.         ditto                         <CMD>N<CR>
  310.     goto end of file                  <CMD>go e<CR>
  311.     goto beginning of range (qv)      <CMD>go rb<CR>
  312.     goto end of range                 <CMD>go re<CR>
  313.  
  314.  
  315. 11.12.  JOIN
  316.  
  317.     join next line onto current       <CMD>joi<CR>
  318.     split line at cursor              <CMD>-joi<CR>
  319.  
  320.  
  321. 11.13.  JUSTIFY
  322.  
  323.     justify rest of current paragraph <CMD>jus<CR>
  324.     justify next N paragraphs         <CMD>jus Np<CR>
  325.     justify next N lines              <CMD>jus Nl<CR>
  326.     insert original text              <CMD>ins a<CR>
  327.  
  328.  
  329. 11.14.  NAME
  330.  
  331.     rename current file               <CMD>nam newname<CR>
  332.  
  333.  
  334. 11.15.  OPEN
  335.  
  336.     open one line above current       <CMD>ope<CR>
  337.     open N lines                      <CMD>ope N<CR>
  338.     open several lines                ^B(CV)ope<CR>
  339.     open block                        ^B(CVH)ope<CR>
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.                                    - 6 -
  356.  
  357.  
  358. 11.16.  PICK
  359.  
  360.     pick up current line              <CMD>pic<CR>
  361.     pick up N lines                   <CMD>pic N<CR>
  362.     pick several lines                ^B(CV)<CMD>pic<CR>
  363.     pick rectanglar block             ^B(CVH)<CMD>pic<CR>
  364.     insert last picked block          <CMD>-pic<CR>
  365.  
  366.  
  367. 11.17.  RANGE
  368.  
  369.     limit search/replace to N lines   <CMD>ran N<CR>
  370.     limit search/replace by cursor    ^B(CV)ran<CR>
  371.     remove range limiting             <CMD>-ran<CR>
  372.     reinstate last range limits       <CMD>ran<CR>
  373.     display no. of lines in range     <CMD>?ran<CR>
  374.  
  375.  
  376. 11.18.  REDRAW
  377.  
  378.     redraw the screen                 <CMD>red<CR>
  379.  
  380.  
  381. 11.19.  REPLACE
  382.  
  383.     replace old with new              <CMD>rep /old/new/<CR>
  384.     replace, next N lines only        <CMD>rep N /old/new/<CR>
  385.     replace, next N paragraphs        <CMD>rep Np /old/new/<CR>
  386.     replace over marked area          ^B(CV)<CMD>rep /old/new/<CR>
  387.     replace, but search backwards     <CMD>-rep /old/new/<CR>
  388.     replace, showing each occurrence  <CMD>rep s /old/new/<CR>
  389.     start interactive replacement     <CMD>rep i /old/new/<CR>
  390.  
  391. The methods of limiting the replacement  area  apply  to  all  forms.   The
  392. string  delimiters  may also be ", *, $, + or '.  See STRING SEARCHES above
  393. for how to proceed with interactive replacement.
  394.  
  395.  
  396. 11.20.  SAVE
  397.  
  398.     save a copy of the current file   <CMD>sav savename<CR>
  399.  
  400. The name savename must be different to that of the file(s) being edited.
  401.  
  402. 11.21.  SET
  403.  
  404.     lines for vertical moves [10]     <CMD>set lin N<CR>
  405.     pages for vertical moves [1]      <CMD>set pag N<CR>
  406.     columns for horizontal moves [16] <CMD>set win N<CR>
  407.     page width [74]                   <CMD>set wid N<CR>
  408.     bell near end of line             <CMD>set bel<CR>
  409.     no bell near end of line          <CMD>set nobel<CR>
  410.     hyphenation on                    <CMD>set hy<CR>
  411.     hyphenation off                   <CMD>set nohy<CR>
  412.     left margin at column N [0]       <CMD>set lm N<CR>
  413.     right margin at column N [74]     <CMD>set rm N<CR>
  414.     display current settings          <CMD>?set<CR>
  415.  
  416. The figures in [] are the defaults.
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.                                    - 7 -
  428.  
  429.  
  430. 11.22.  SPLIT
  431.  
  432.     split current line at cursor      <CMD>spl<CR>
  433.     rejoin split line                 <CMD>-spl<CR>
  434.  
  435.  
  436. 11.23.  TAB
  437.  
  438.     set extra tab at cursor position  <CMD>tab<CR>
  439.     set tabs at columns N, M, ...     <CMD>tab N M ...<CR>
  440.     remove tab at cursor position     <CMD>-tab<CR>
  441.     remove tabs at columns N, M, ...  <CMD>-tab N M ...<CR>
  442.     set extra tabs every N columns    <CMD>tabs N<CR>
  443.     remove all tabs                   <CMD>-tabs<CR>
  444.     set tabs to column nos. in file   <CMD>tabfile filename<CR>
  445.  
  446.  
  447. 11.24.  TRACK
  448.  
  449.         move alternate file by same number
  450.         of lines as current one       <CMD>tra<CR>
  451.     turn off tracking                 <CMD>-tra<CR>
  452.  
  453.  
  454. 11.25.  UPDATE
  455.  
  456.     update current file on exit       <CMD>upd<CR>
  457.     don't update file on exit         <CMD>-upd<CR>
  458.  
  459. The latter is useful when editing  multiple  files  to  prevent  accidental
  460. changes to a file which is just being looked at.
  461.  
  462. 11.26.  WINDOW
  463.  
  464.     create a window into newfile      <CMD>w newfile<CR>
  465.     create new window in current file <CMD>w<CR>
  466.     remove last window created        <CMD>-w<CR>
  467.  
  468. To create a horizontal window, place the cursor on the left  margin  first.
  469. To create a vertical window, place it on the top margin.
  470.  
  471. 12.  EXTERNAL COMMANDS
  472.  
  473. Many ordinary system commands may be executed from the editor.  The  speci-
  474. fied area of the current file is used as standard input, and is replaced by
  475. the standard output of the command.
  476.  
  477.     run command using current line    <CMD>run cmd<CR>
  478.     run command over N lines          <CMD>run N cmd<CR>
  479.     run command over several lines    ^B(CV)<CMD>run cmd<CR>
  480.  
  481. To leave the original lines untouched, use feed instead of  run.  All  com-
  482. mands may take their usual arguments.
  483.  
  484. 12.1.  TEMPORARY ESCAPES
  485.  
  486.     save files, call up the shell     <CMD>sh<CR>
  487.     save files, call a command        <CMD>cal cmd<CR>
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.                                    - 8 -
  500.  
  501.  
  502. 12.2.  EXAMPLES
  503.  
  504.     sort next N lines                 <CMD>run N sort<CR>
  505.     insert date at current line       <CMD>feed date<CR>
  506.     list directory, return to edit    <CMD>cal ls -l<CR>
  507.  
  508.  
  509. 13.  VARIATIONS ON COVER
  510.  
  511. The following assume that a block of text is already in the pick buffer.
  512.  
  513.         write a space for each printing
  514.         character in the buffer       <CMD>blot<CR>
  515.         write a space for each space in
  516.         the buffer                    <CMD>-blot<CR>
  517.         overlay file with printing
  518.         characters from the buffer    <CMD>over<CR>
  519.         underlay: as above but only spaces
  520.         in the file are affected      <CMD>under<CR>
  521.  
  522. All the above work with the close and erase buffers too: the  corresponding
  523. commands are blot c, blot e, etc.  Some experimentation is recommended!
  524.  
  525. 14.  MISCELLANEOUS
  526.  
  527. Unless otherwise stated, turn mode off by preceding with a '-':
  528.  
  529.     enter auto wrap mode              <CMD>wp<CR>
  530.     searches use regular expressions  <CMD>re<CR>
  531.         don't display CRs; if any exist
  532.          change NL to CR-NL on exit   <CMD>cr<CR>
  533.     cursor sticks at side margins     <CMD>set sti<CR>
  534.     no stick, window rolls sideways   <CMD>set nosti<CR>
  535.     change block to upper case        ^B(CVH)<CMD>cap<CR>
  536.     change case in block              ^B(CVH)<CMD>cca<CR>
  537.     help                              <CMD>h<CR>
  538.  
  539.  
  540. 15.  DISASTER RECOVERY
  541.  
  542. The effect of most functions and commands can be  reversed,  provided  that
  543. this  is  done  straight away. All deleted and adjusted text blocks are put
  544. into the temporary file fio which may be brought onto the screen using  the
  545. EDIT  command  and picked from. All picked text is saved in fip. Both files
  546. are deleted on exit from the editor.
  547.  
  548. If an edit is aborted for any reason, it may be  replayed  and  interrupted
  549. just  before  the  disaster  point; this requires a quick trigger finger at
  550. 9600 baud, however!  Replays are tricky; make copies of all affected  files
  551. before trying one.
  552.  
  553. Each edit session leaves a "comma file", which is a copy  of  the  previous
  554. version  of  a  file with the name prefixed with a comma.  For this reason,
  555. filenames should be restricted to 13 characters.  Remember that  restarting
  556. the  editor  will destroy the previous comma file; in any case, comma files
  557. are deleted periodically by the system.
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.                                    - 9 -
  572.  
  573.  
  574. 16.  SEE ALSO
  575.  
  576. The command line options are described in man 6 e.
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641. -- 
  642. Mike O'Carroll, Department of Electronic & Electrical Engineering,
  643.         The University, Leeds, LS2 9JT, UK
  644. E-mail: @ukc.ac.uk:mike@ee.leeds[.ac.uk]
  645. uucp:  ...!mcsun!ukc!lena!mike OR mike@lena.uucp
  646.