Copyright (c) Hyperion Entertainment and contributors.
Difference between revisions of "AmigaOS Manual: AmigaDOS Using the Editors"
Steven Solie (talk | contribs) (→ED) |
Steven Solie (talk | contribs) |
||
Line 177: | Line 177: | ||
To invoke a file requester for a load or save command, you must place a question mark (?) before the required string argument. Be sure to include a space before the question mark (for example, sa ?/Text/). Normally, when a command is followed by a string. ED treats the string as the file to be loaded or saved and attempts the operation immediately. However, the question mark indicates that you want to specify the file through a file requester. You must still specify a string after the question mark, but the string becomes the text that appears in the file requester title bar. |
To invoke a file requester for a load or save command, you must place a question mark (?) before the required string argument. Be sure to include a space before the question mark (for example, sa ?/Text/). Normally, when a command is followed by a string. ED treats the string as the file to be loaded or saved and attempts the operation immediately. However, the question mark indicates that you want to specify the file through a file requester. You must still specify a string after the question mark, but the string becomes the text that appears in the file requester title bar. |
||
+ | |||
+ | == ED Menus == |
||
+ | |||
+ | ED has two sets of command menu assignments: default and expanded. The default menu assignments, as illustrated in Figure 4-2, are set up by the S:Ed-startup file, which is automatically executed each time you run ED. The S:Ed-startup file is a command file of ED extended mode commands, without the Escape characters. You can edit this file to set up custom menus, as described on page 4-21, or define preprogrammed function key assignments with the Set FN Key menu item. |
||
+ | |||
+ | Figure 4-2. Default Menu Assignments |
||
+ | |||
+ | === Enabling Expanded Menus === |
||
+ | |||
+ | The expanded command menu assignments, as illustrated in Figure 4-3, can be enabled by renaming or deleting the default S:Ed-startup file. If ED cannot find a file named S:Ed-startup, it opens with the expanded set of menus, providing more options. |
||
+ | |||
+ | Figure 4-3. Expanded Menu Assignments |
||
+ | |||
+ | Rather then deleting your S-Ed-startup file, we recommend that you rename it as follows: |
||
+ | |||
+ | # In the Workbench window, go to the Window menu and select Show All Files. |
||
+ | # Double-click on the S drawer icon. |
||
+ | # Click on the Ed-startup icon. |
||
+ | # Go to the Icons menu and choose Rename. |
||
+ | # Delete the name in the Rename requester's New Name text gadget and enter a new name for Ed-startup. |
||
+ | # Select OK. |
||
+ | |||
+ | You can also create your own customized file of startup options. Avoid including Quit commands in the S:Ed-startup file since they can cause ED to quit immediately after opening. |
||
+ | |||
+ | The menu items in both the default and expanded menus have the same function regardless of which set you use. All of the ED commands are available through the keyboard using extended mode commands even if they do not appear in any menu. |
||
+ | |||
+ | The following sections describe the menu items found in the expanded menus and their corresponding extended and immediate mode commands. An ellipsis (...) indicates that an argument is required or that a menu item opens a requester or prompt. |
||
+ | |||
+ | === Project Menu === |
||
+ | |||
+ | The following are the expanded Project menu items: |
||
+ | |||
+ | {| class="wikitable" |
||
+ | | New || Esc,N,W || Creates a new file, replacing the existing file. The message Edits will be lost-type Y to confirm: is displayed. Press any key (except Y) to abort the command. |
||
+ | |- |
||
+ | | Open... || Esc,O,P... || Opens a file. Specify the file by entering the path to the file as a properly delimited string. (If slashes appear in the path to a file, do not use the slash as a delimiter.) The message Edits will be lost-type Y to confirm: reminds you that you are replacing the current file. |
||
+ | |- |
||
+ | | Insert File... || Esc,I,F... || Inserts a file into the current file. ED reads into memory the specified file at the point immediately following the current line. |
||
+ | |- |
||
+ | | Write Block... || Esc,W,B... || Writes the currently marked block to a specified file. ED overwrites any other files with that name and copies the block to the file. |
||
+ | |- |
||
+ | | Save || Esc,S,A || Saves the text to the current file, overwriting the existing text in the file. Use Save As to save to different file. SA followed by Q is equivalent to the X command. |
||
+ | |- |
||
+ | | Save As... || Esc,S,A... || Saves the text to the specified file name. |
||
+ | |- |
||
+ | | Save & Exit || Esc,X || Exits ED, saving the current file to the designated file name. ED writes the text it is holding in memory to the file that was specified when ED was opened and then terminates. |
||
+ | |- |
||
+ | | About || Esc,S,H || Shows the current state of the editor. The screen display information, such as the value of tab stops, current margins, block marks, and the name of the file being edited. |
||
+ | |- |
||
+ | | Quit || Esc,Q || Exits ED without saving changes. If you made any changes to the file, ED asks if you want to quit. If you press Y, ED terminates immediately without saving the changes to the file. |
||
+ | |} |
||
+ | |||
+ | === Edit Menu === |
Revision as of 04:45, 25 January 2014
A text editor or word processing program is necessary for creating or editing text files and script files. Amiga Workbench software comes with three text editors. This chapter describes them in the following order:
- ED
- MEmacs
- EDIT
Each of the Amiga editors can be used separately for editing AmigaDOS scripts and programs; ED and MEmacs can be used for creating these files. If you are comfortable with the UNIX Emacs editor, you may prefer using the MEmacs editor. If you need to edit files containing binary code or you need to edit files too large to fit into memory, use EDIT. If you are not familiar with any of the editors, we recommend that you use the ED editor.
Each editor has the basic functionality of a word processor, however, none of these editors support style formatting options, such as italics, page numbering, or different fonts. If you need these features, you can purchase third party word processing software containing such features for your Amiga.
Contents
ED
ED is a full screen ASCII text editor that uses menus and function keys to access its features. It is easy to use and is suitable for editing scripts, startup files, MountLists, and other simple files. Use either a mouse or the keyboard to perform operations with ED. Although ED's menus are preprogrammed, when you are familiar with the program, you can reconfigure them as needed.
Note |
---|
ED does not accept files containing binary code. To edit this type of file, use EDIT or MEmacs. |
The bottom line of the ED window is the status line used for displaying messages, prompts, and commands. Error messages displayed on the status line remain until you enter another ED command. Figure 4-1 illustrates the ED window showing the status line.
Figure 4-1. ED Window with Status Line
The format for ED is the following:
ED [FROM] <filename> [SIZE <n>] [WITH <filename>] [WINDOW <window specification>] [TABS <n>] [WIDTH | COLS <n>] [HEIGHT | ROWS <n>]
The FROM argument specifies the source file to be edited. This argument is required, but the FROM keyword is optional.
The SIZE argument changes the ED buffer size. ED has a default text buffer size of 40,000 bytes. For example:
1> ED Script SIZE 55000
increase the size of the buffer to 55,000 bytes.
The WITH argument specifies an ED command file that can contain any sequence of ED extended mode commands. When WITH is specified, ED executes the commands contained in the command file. The WITH argument's keywords is required if you use WITH.
The WINDOW argument specifies the console type, such as RAX:0/0/640/256/EdWindow or CONSOLE:. The WINDOW argument's keyword is required if you use WINDOW.
TABS sets the tab stop interval, which is the number of spaces to the right that the cursor moves when you press the Tab key. The default value for TABS is 3.
The WIDTH and HEIGHT arguments adjust the size of the ED window by specifying the number of characters to display horizontally and vertically. By default the ED window is 640 x 200 picels or approximately 88 characters wide by 21 lines high.
Starting ED
Start ED from a Shell or with the Workbench Execute Command menu item. Open ED at the prompt by entering ED and a new or existing file name, as follows:
1> ED <filename>
where <filename> is the name of an existing file or a new file to be used for saving your work. If the file name specified cannot be found in the current directory, ED opens a blank window and displays the message Creating new file.
Using ED
All ED commands have key sequences and many are available through menus. You can enter ED commands in either of the following ways:
- By choosing the command's menu item.
- By typing in the command's key sequence and pressing Return.
In addition, you can use the mouse to perform some commands, such as those that control cursor movement.
You can work on files in ED with the following two command modes:
- Immediate
- Commands are executed as soon as typed. EP opens in immediate mode.
- Extended
- Commands are not executed until you press Return or Esc.
Immediate Commands
In immediate mode, ED executes commands right away. Specify an immediate command by pressing a single key or Ctrl+key combination or by using the mouse. All immediate commands have corresponding extended versions.
Immediate commands control the following:
- Cursor movement
- Text scrolling
- Text insertion
- Text deletion
- Repetition of commands
Moving the Cursor in Immediate Mode
The cursor can be positioned anywhere in text by moving the pointer to the desired spot and clicking the selection button. To move the cursor with the keyboard, use the arrow keys, Tab, and Ctrl+key combinations.
Note |
---|
In ED, the Tab key only moves the cursor. It does not insert Tab characters or spaces in a line. |
Move the cursor one position in any direction by pressing the appropriate arrow key. If the cursor is on the right edge of the screen, ED scrolls the text to the left do display the rest of the line. ED scrolls the text vertically one line at a time and horizontally ten characters at a time. You cannot move the cursor beyond the left edge of the line. If you try to move the cursor beyond the top or bottom of the file, ED displays a Top of File or Bottom of File message.
Additional key combinations that control cursor movement are:
Shift+up arrow | Top of the file. |
Shift+down arrow | Bottom of the file. |
Shift+left arrow | Left edge of the ED window (regardless of the margin setting). |
Sift+right arrow | End of the current line. |
Ctrl+] | Right edge of current line (if cursor is already there, it is moved to the left edge). |
Ctrl+E | Start of the first line on the screen (if cursor is already there, it is moved to the end of the last line on the screen). |
Ctrl+T | Start of the next word. |
Ctrl+R | Space following the previous word. |
Tab | The next tab position (multiple of the TABS value; 3 by default). |
If your file has more lines than can fit in the ED window, you can scroll through the file vertically. Scroll one line at a time by pressing the up or down cursor key to move in the corresponding direction. Move the text in jumps by pressing:
Ctrl+D | Moves 12 lines down through the file. |
Ctrl+U | Moves 12 lines up through the file. |
These commands do not move the cursor position in the window; they redraw the text in the window with the new line at the cursor position.
If something disturbs your screen, such as an alert from another program appearing in the ED window or message remarks in the status line, press:
Ctrl+V | Refreshes the window display. |
Inserting Text in Immediate Mode
Any characters typed in immediate mode are inserted at the current cursor position and the cursor is shifted to the right. Any characters to the right of the cursor are shifted to make room for new text. If the line is wider than the width of the window, the window scrolls to the right to show what you are typing. If you move the cursor beyond the end of the line, ED inserts spaces between the end of the line and any new characters inserted.
There is maximum limit of 255 characters in a line. If you add more characters, ED displays a Line Too Long message.
To split the current line at the cursor, press Return. Any text to the left of the cursor remains on the original line. All text under and to the right of the cursor moves down onto a new line. Pressing Return at the end of the line creates a new blank line.
Deleting Text in Immediate Mode
ED has no type over mode. To replace a word or line, you must delete the existing words and insert new information with the following keys and key combinations:
Backspace | Deletes the character to the left of the cursor. |
Del | Deletes the character highlighted by the cursor. |
Ctrl+O | If the cursor is over a space, all spaces up to the next character are deleted. If the cursor is over a character, all characters up to the next space are deleted. |
Ctrl+Y | Deletes all characters from the cursor to the end of the line. |
When text is deleted, any characters remaining on the line shift to the left and any text beyond the right edge of the screen becomes visible.
Changing Case in Immediate Mode
You can change the case of text by positioning the cursor and pressing Ctrl+F. If the letter is lower case, it becomes upper case and vice versa. Ctrl+F does not change non-alphabetic characters or symbols.
After you press Ctrl+F, the cursor moves to the right. You can hold down Ctrl+F to repeat the command until you change all the letters on the line.
Extended Commands
In extended mode, commands are displayed on the command line - or status line - at the bottom of the window. ED does not execute these commands until you press Return or Esc. If you use Esc to execute extended commands, ED remains in extended mode. If you use Return to execute extended commands, ED returns to immediate mode.
Extended commands manage the following:
- Program control
- Cursor movement
- Text modification
- Block control
- Searching and exchanging text
To enter extended mode, press Esc. An asterisk appears as a prompt in the status line. Extended commands consist of one or two characters. Multiple extended commands can be typed on a single command line by separating them with a semicolon. Commands can be grouped together for ED to repeat automatically. Use Backspace to correct mistakes.
You can also execute commands through the programmable menu and function keys. Reconfigure the menus and functions keys by assigning a command to the key or menu item of your choice as described on page 4-21.
Using String Delimiters
In some cases, commands require arguments, such as a number or a text strig. A string argument for an ED command must be enclosed in a pair of identical delimiter characters. In unambiguous situations you may omit the trailing delimiter. Valid delimiters include ", /, \, !, :, +, -, and %. You cannot use the same delimiter character inside your string. Invalid delimiter characters include letters, numbers, spaces, semicolons, question marks, brackets, and control characters.
Using a File Requester
You can also ask ED to use a file requester, allowing you to view the contents of the drives and directories in your system.
To invoke a file requester for a load or save command, you must place a question mark (?) before the required string argument. Be sure to include a space before the question mark (for example, sa ?/Text/). Normally, when a command is followed by a string. ED treats the string as the file to be loaded or saved and attempts the operation immediately. However, the question mark indicates that you want to specify the file through a file requester. You must still specify a string after the question mark, but the string becomes the text that appears in the file requester title bar.
ED Menus
ED has two sets of command menu assignments: default and expanded. The default menu assignments, as illustrated in Figure 4-2, are set up by the S:Ed-startup file, which is automatically executed each time you run ED. The S:Ed-startup file is a command file of ED extended mode commands, without the Escape characters. You can edit this file to set up custom menus, as described on page 4-21, or define preprogrammed function key assignments with the Set FN Key menu item.
Figure 4-2. Default Menu Assignments
Enabling Expanded Menus
The expanded command menu assignments, as illustrated in Figure 4-3, can be enabled by renaming or deleting the default S:Ed-startup file. If ED cannot find a file named S:Ed-startup, it opens with the expanded set of menus, providing more options.
Figure 4-3. Expanded Menu Assignments
Rather then deleting your S-Ed-startup file, we recommend that you rename it as follows:
- In the Workbench window, go to the Window menu and select Show All Files.
- Double-click on the S drawer icon.
- Click on the Ed-startup icon.
- Go to the Icons menu and choose Rename.
- Delete the name in the Rename requester's New Name text gadget and enter a new name for Ed-startup.
- Select OK.
You can also create your own customized file of startup options. Avoid including Quit commands in the S:Ed-startup file since they can cause ED to quit immediately after opening.
The menu items in both the default and expanded menus have the same function regardless of which set you use. All of the ED commands are available through the keyboard using extended mode commands even if they do not appear in any menu.
The following sections describe the menu items found in the expanded menus and their corresponding extended and immediate mode commands. An ellipsis (...) indicates that an argument is required or that a menu item opens a requester or prompt.
Project Menu
The following are the expanded Project menu items:
New | Esc,N,W | Creates a new file, replacing the existing file. The message Edits will be lost-type Y to confirm: is displayed. Press any key (except Y) to abort the command. |
Open... | Esc,O,P... | Opens a file. Specify the file by entering the path to the file as a properly delimited string. (If slashes appear in the path to a file, do not use the slash as a delimiter.) The message Edits will be lost-type Y to confirm: reminds you that you are replacing the current file. |
Insert File... | Esc,I,F... | Inserts a file into the current file. ED reads into memory the specified file at the point immediately following the current line. |
Write Block... | Esc,W,B... | Writes the currently marked block to a specified file. ED overwrites any other files with that name and copies the block to the file. |
Save | Esc,S,A | Saves the text to the current file, overwriting the existing text in the file. Use Save As to save to different file. SA followed by Q is equivalent to the X command. |
Save As... | Esc,S,A... | Saves the text to the specified file name. |
Save & Exit | Esc,X | Exits ED, saving the current file to the designated file name. ED writes the text it is holding in memory to the file that was specified when ED was opened and then terminates. |
About | Esc,S,H | Shows the current state of the editor. The screen display information, such as the value of tab stops, current margins, block marks, and the name of the file being edited. |
Quit | Esc,Q | Exits ED without saving changes. If you made any changes to the file, ED asks if you want to quit. If you press Y, ED terminates immediately without saving the changes to the file. |