Using CRISP Outline I. CRISP Basics II. Moving Around in CRISP III. Inserting and Deleting Text IV. Cutting and Pasting Text V. Search and Replace VI. File and Buffer Manipulation VII. Window Manipulation VIII. Using Undo IX. Getting On-Line Help
Using CRISP To create, change or view text files we use a text editor. There are many editors available on the Economic Department SUN network. CRISP is an intuitive and easy editor. Other editors available on the system are vi, pico, text edit and emacs. I. CRISP Basics To create a new file, at the UNIX prompt type: cr newfilename For example, if we want to create a file called practice.txt, we type: cr practice.txt which opens a CRISP window that looks like the following: You can simply begin typing to enter text. You can use the arrow keys on the keypad on the right of the keyboard to move around in CRISP. You cannot use your mouse with CRISP. There are numerous keystroke commands in CRISP that can be used to edit the text. The text you type now is stored in the buffer. Until you save this buffer to disk, the file practice.txt remains empty. It is a good idea to save regularly during editing sessions. To save your file in CRISP, press: <Diamond W> By Diamond we mean the key beside the Space Bar with a black diamond on it. To save you press the Diamond key and the W key at the same time. You should see the message 'write successful' at the bottom of the screen to the left. To exit Crisp, press: <Control X> This will return you to the UNIX prompt. To open a crisp file that has already been created, at the UNIX prompt type: cr filename.txt 2
For example, to reopen the practice.txt file, i.e. to enter more text or to correct errors, we type: cr practice.txt You can also save the buffer to a different filename. For example, if you are editing a file called practice.txt and you want to save the edited version as program.txt you use <Diamond O> to change the name of the file. You will be prompted to enter the new filename. II. Moving Around in CRISP Moving Around in CRISP Files Move cursor right one position (won't go beyond text of current line) Move cursor left one position (will go beyond beginning of current line) Move cursor down one line, maintaining same column position Move cursor up one line, maintaining same column position Move cursor to beginning of current line Move cursor to top of current window Move cursor to beginning of buffer Move cursor to last character of current line Move cursor to end of current window Move cursor to end of buffer Move cursor to start of next word Move cursor to start of previous word or <spacebar> or <backspace> <Home> <Home><Home>, i.e. press key twice <Home><Home><Home>, i.e. press key three times <End> <End><End> <End><End><End> <Control RightArrow> <Control LeftArrow> III. Inserting and Deleting Text Inserting text is simple - just start typing. Be careful about deleting text, once you delete it, it's gone. Deleting Text in CRISP Delete the last character typed <BackSpace> Delete the character under the cursor <Delete> Delete the current line <Diamond D> Delete characters to right of cursor on current line <Diamond K> Delete word to left of the cursor <Control K> Delete word to right of the cursor <Control L> IV. Cutting and Pasting Text If we want to copy a block of text from one part of a buffer (think of a buffer as a file) to another, or from one buffer to another, we use the 'scrap'. The scrap is a temporary storage area for text which has been cut or copied from a buffer and can then be inserted as many times as necessary to some other buffer. Cutting text is different from deleting text. Cutting text deletes the original text but saves it so it can be inserted elsewhere. The deleted text is gone. In order for a piece of text to be cut/copied and then pasted it must first be highlighted. To highlight a region of text, the user first drops an anchor. As the cursor is moved away from the anchor, the text 3
between where the anchor was dropped and the current cursor position is highlighted, showing the text which can be cut or copied. There are two types of regions, column and line. A line type is used to cut/copy and paste whole lines. A column type is used to cut/copy and paste columns of text. Cutting/Copying and Pasting in CRISP Drop a line marker. Text falling within a rectangular region from where the anchor was dropped to the current cursor will be highlighted. Drops a column marker. Text falling within a rectangular region from where the anchor was dropped to the current cursor will be highlighted If no region is currently highlighted, then the current line is cut to the scrap buffer. If there is a highlighted region, then that region is copied to the scrap and deleted. If no region is currently highlighted, then the current line is coped to the scrap buffer. If there is a highlighted region, then that region is copied to the scrap without being deleted. Paste the contents of the scrap buffer into the current buffer at the current cursor position. For line-types regions, the lines are inserted before the current line rather than inserting where the cursor is. <Diamond L> <Diamond C> <->, which is the minus key on the keypad <+>, which is the plus key on the keypad <Ins> V. Search and Replace Search and Replace in CRISP Search in a forward direction. The user is prompted for the search item <Diamond S> Search in a backwards direction. The user is prompted for the search item <Diamond Y> Search for the next occurrence of an item in either the forward or <Shift F5> backwards direction, depending on the last search. Performs a replace in the forwards direction. Prompts the user for a item to <F6> search for (translate) and an item to replace it with. For each matched occurrence of the item, the user is prompted for whether to change or not. Performs a replace in the backwards direction <Diamond F6> Repeats last replace in the same direction <Shift F6> Toggles the case sensitivity. The default is for case sensitivity to be turned <Control F5> on. When turned off, lower case characters match against upper case and vice versa VI. File and Buffer Manipulation Files are always accessed by loading them into a buffer. CRISP is able to keep multiple files in memory at once, which allows the user to move among them easily. Once a user is in CRISP they can call up as many files as they need to use by loading them into a buffer within CRISP. Pop-up menus are often used when moving among files. How to choose options on the pop-up menu is self-evident. To exit a pop-up menu use the <Esc> key. 4
File and Buffer Manipulation in CRISP Call up a file to be edited. The user is prompted for the name of the file. <Diamond E> Hitting <Tab> pops up a menu of filenames the user can select from. Pops up a window containing a list of the files currently in memory <Diamond B> VII. Window Manipulation Your CRISP window can be 'tiled' and used to look at more than one file at the same time, or different parts of the same file at the same time. By tiling, we mean the window can be split horizontally or vertically. This can be done as many times as you like, i.e. you can split your window into as many sections as you like. Different buffers (files) can be viewed in different sections of the tiled window, or even different parts of the same buffer. Each section of the tiled window can be treated as an individual CRISP session. Any changes to a buffer made in one part of a tiled window are displayed in the other parts of the tiled window displaying the same part of the same buffer. Window Manipulation in CRISP Select a different section of a tiled window. User is prompted to point to the section desired, using one of the four arrow keys. Move the boundary between two windows on the screen. User is prompted to point the boundary which is to be moved, and then use the arrow keys to move the boundary. The screen is redrawn as the boundary is moved. Split the current window into two equal sizes, either horizontally or vertically. Delete a boundary between two windows and merge them together <F1> <F2> <F3> <F4> VIII. Using Undo The <Diamond U> command can be used to undo any commands in the current buffer. Commands can be undone sequentially all the way back to the point where the buffer was opened in CRISP or saved to disk. If you undo too much you can use redo to cancel the last undo. The redo command is <Control U>. IX. Getting On-Line Help Use the <Diamond H> command to get on-line help. 5