ED LINE EDITOR FOR LUNIX ------------------------ by Ilker Ficicilar filker@newton.physics.metu.edu.tr e068214@orca.cc.metu.edu.tr February 1997 Version 0.1 alpha usage: ed [file-name] ED editor is coded mainly for the CLI ( Command Line Interface ) shells, which are only capable of simple keyboard activities, such as spacing and backspacing along a line. All implementations of ED has two modes; command mode and entry mode. The command mode can be identified with the colon character on the left, and it is the mode you are in when ED starts. Entry mode is used to enter a maximum of 254 characters of line into the text buffer, which is held in the internal memory. To enter the entry mode one of the 'a' or 'i' commands can be used. Each time you pressed the return key in the entry mode you begin to enter next line of text. After editing one can return to the command mode by simply issuing a '.' (period) character as the first and only character of a line. And to obtain some dots in the begining of a line you have to enter one more dot. In the command mode you can select any of the text line as the current line by entering its number. And if you continuously press the return key you see and advance the current line by one. You can learn which line is the current line by '=' command, and see its content by '.' command. The '-' command selects the previous line, while '+' selects the next line. To see one screen of text, 'z' command can be used. Entering only 'z' or 'z+' prints next 24 lines, and 'z-' prints previous 24 lines, while 'z.' prints previous and next 11 lines to the stdout. Issuing 'z' command with a preceeding number sets the current line to that number then executes the 'z' command. For example '100z' shows lines 100 through 123, and '1,100z' shows lines 1 through 100. Deleting the current line can be achieved using the 'd' command. If you enter this 'd' command successively you can delete following lines. But if the current line is the last line, 'd' command deletes previos lines. Current implementation does not support the range delete case. If the ED command is used with a file name of an existing (valid) file, this file is loaded at the start and this name is used as the document's name. If this is not the case you can read a file by 'r ' command. And after giving a document name with 'f [name]' command you can write the document to the disk by 'w' command. Issuing 'f' without a parameter shows the name of the document if exist. To leave the ED you can use one of the three ways. Entering 'x' command saves the document and then exits. 'q' command quits without saving. And stop, break or ^C keys terminates the ED urgently. A brief summary of implemented commands are below: i : Switching to entry mode by inserting before the current line. a : Switching to entry mode by inserting after the current line. . : I command mode shows the current line. In entry mode switches to command mode = : Shows the number of the current line + : Steps to next line ( same as return key ) - : Steps to previous line z : Views 24 lines of text ( versions are : z+ z- z. #z[+-.] #,#z[+-.] ) d : Deletes the current line r : Reads a petscii text file ( r ) f : Views or sets the document name to be used when saving. w : Save the document x : Save and exit q : Quit stop : Terminate Thats all for now. Future versions will include more commands and features. Also current implementation is somehow buggy and slow, so do not trust it too much. Ilker Ficicilar filker@newton.physics.metu.edu.tr