**EDIT** is a line-oriented text editor for TOPS-20 on TWENEX.ORG. ===== Invocation ===== EDIT is usually started with the ''EDIT'' command. However, if you have [[tutorials:editor|customized your default editor]], the ''EDIT'' command may invoke a different editor. To run EDIT without disturbing your default editor setting, use the command ''SYS:EDIT'' or ''R EDIT''. ===== Command Line Editing ===== As a line-oriented editor, all editing tasks are accomplished in EDIT by entering commands at the EDIT command prompt (''*''). If you wish to make changes to the current command line before submitting it (by pressing ''Enter''), you may use the following keys: * ''Delete'' (usually mapped to the ''Back Space'' key) -- Delete one character to the left of the cursor. * ''Ctrl-U'' -- Delete the entire command line without submitting it. ===== Basic Commands ===== * ''D''//a//['':''//b//] -- Delete line //a// (through line //b//). * ''E'' -- Save file and return to EXEC. * ''EQ'' -- Discard unsaved changes and return to EXEC. * ''I''//a// -- Insert mode after line //a//. End with ''Esc'' key. * ''P''//a//['':''//b//] -- Print line //a// (through line //b//) on terminal. * ''R''//a// -- Replace line //a// * ''S''//t//''Esc''//u//''Esc''//a// -- Substitute text //u// for text //t// on line //a//. ===== More Commands ===== TWENEX's on-line help file for EDIT is reproduced below. Summary of EDIT commands 10-Feb-76 I Insert [,] P Print [][,N] . Move pointer [] D Delete [] K Kill page mark [/] R Replace [,] E End (Exit to command level) EN Suppress ".Qxx/.Zxx" file creation EI Insert identifying line before ending EJ Delete first line of file and do an EI command EQ Quit (while you're ahead) EU Unsequence output file G Go (Exit and do last LOAD-class command) GI Do an EI command, and then go GJ Do an EJ command, and then go GN Do an EN command, and then go GU Do an EU command, and then go B Backup - (same as E but leaves you at EDIT command level) BI Do an EI command, without ending BJ Do an EJ command, without ending BN Do an EN command, without ending BU Do an EU command, without ending M Mark [] N Number [,,] NA Add to NP Preserve line numbers over page marks L List (on LPT) [] J Join [] F Find [$,] S Substitute [$$,] C Copy [,] or [=,] or [=/S] T Transfer [,] X eXtend [,L] (,L suppresses typeout) H Help (types this text) ? Types list of available commands Same as P.+1 $ Same as P.-1 @ Indirect command file A Alter [] ? Print list of alter commands nC Change n characters -nD Delete next/last characters E Finish with no printing -nF Find the nth next/previous occurrence of nI$ Insert with temp increment n J Break line and stick rest at front of next -nK Delete to n occurrences of L Print line and recycle P Print line and recycle to current position Q Quit ALTER (restore original line) -nR$ nD then 0I nW Skip forward n words X$ Delete word then 0I -n Space forward/backward n characters Finish and print rest of line n Backspace n characters n Backspace n characters - Skip to end/start of line ^U Quit and restart ALTER EDIT parameters:* name set print default value what . n y --- current ? n y --- /? list settable switches =? list printable switches BAK y y on create backup file <.Qxx> BIG n y --- largest page # C64 y CASE on 64 character set C128 y CASE off 128 character set CASE n CASE C64 M33 UPPER give case information DECIDE y y off auto ",D" for "S" command DPY y n off special display mode ERROR n y --- print last error message EXPERT y n off Q.E.D INCREMENT y y 100 default line increment INSERT y n --- location of next I ISAVE y y 0 controls auto-W on inserts LOCATION n y --- first line in edit buffer LOWER y CASE off default lower case M33 y CASE on terminal characteristics M37 y CASE off terminal characteristics NAME y y --- output file spec NOBAK y n off no backup file NODECIDE y n on no auto ",D" NONSEPARATORS y CASE on %,$,. are not alphanumerics NONUMBER y n off don't print line numbers NOVICE y n on normal mode NUMBER y n on print line numbers on terminal OLD y n off creat backup file (.Zxx) OPTION y n --- read "SWITCH.INI" file PLINES y y 16 used by "P R Same as RONLY RONLY y n off read-only file READONLY Same as RONLY RUN y y LOAD-class set run spec SAVE y y 0 controls auto-W on commands SEPARATORS y n off treat %,$,. as alphanumeric START y y 100 starting sequence # STEP y y 100 default line increment STRING n y --- current F & S strings UNSEQUENCE y n off unsequence output file UPPER y CASE on default upper case WINDOW y y 8 size of edit file window * All settable parameters may be specified as switches in the initial command string. EDIT special characters: Replacement: ^B '" next match string ^O '* '*'* is nth match string ^^ '7 quote next character Match: ^E '% not ^N ') arbitrary number of ^T '/ any character ^^ '7 quote next character ^ ': separator Positions: . present line or page ^ first line or page * last line or page EDIT definitions and meanings: ::= [! or :] ::= [][/] ::= [ or or . or * or ^][(+-)] ::= [ or . or * or ^][(+-)] ::= $$, ::= any positive integer .LE. 2^35-1 Options: ,D Decide on each substitution (S command) ,E Match upper/lower case characters Exactly (F and S commands) ,L Do not print contents of line (F, S, and X commands) ,A Enter ALTER mode (F and S commands) ,N Do not print line number (P command) Special functions of the "I" command: I default is set to end of last: Replace, except at end of page Insert, except wrap around or out of space I/ does insert page mark at end of followed by Istart, where start is the value of the START switch (Originally, the START switch is set at 100). I!n allows insertion of n lines; calculates increment from table of aesthetic values. I^ inserts a line at the top of the page, halfway between line 0 and the first line. EDIT Command Format: @CREATE (FILE) /switches input.typ.gen or, @EDIT (FILE) /switches input.typ.gen (OUTPUT AS) output.typ.gen CREATE requires that input.typ.gen is a new file; EDIT works regardless of whether the file exists or not. /switches is a list of settable switches which may be recognized. If an illegal switch is encountered, the entire command is ignored. input.typ.gen, and output.typ.gen are TOPS-20 file specifications; recognition is available. Output.typ.gen defaults to input.typ.-1 if it is not explicitly typed. ===== References ===== * [[http://tilt.twenex.org/|TOPS-20 User's Guide]] * //(__EDIT User's Guide__ and __EDIT Reference Manual__ were published by DEC as part of the TOPS-20 Software Notebook series, but the author has been unable to locate any printed or electronic copies of either manual.)//