Appendix B. NEdit and jot

NEdit and jot are two commonly used text editors that run on Silicon Graphics workstations. Although NEdit is the default editor for IRIX, both editors are described in this appendix.

To start NEdit or jot, open the Find menu in the Toolchest, select Applications, and click on the appropriate icon. To start either editor from a shell window, type the name of the editor (use all lowercase characters).


Tip: When you run NEdit or jot from a shell, you can run it in the background so that your cursor is returned to you. For example, to run NEdit in the background, enter nedit&

Whether you are using NEdit or jot, to protect your work, save your file periodically. To save your document, use the following procedure:

  1. Choose “Save” from the File menu.

    If your document is untitled, the first time you choose “Save,” the “Save As...” dialog box appears. Enter a filename, or a complete pathname, for your new jot document. Using the Save command thereafter simply saves any modifications you have made to your document, and no dialog box appears.

    Remember that capitalization is important: file and File are two different files.

  2. Press Enter.

Choose the “Save As...” command to save a copy of your document under a different filename.

About NEdit

NEdit is a standard graphical user interface (GUI) text editor for programs and plain text files. NEdit offers the following features:

  • NEdit provides standard menu, dialog, editing, and two-button mouse support.

  • NEdit offers standard keyboard shortcuts and menu accelerators.

  • In NEdit you can have any number of files open at the same time.

  • NEdit offers several methods for copying and moving text.

  • NEdit offers a search function that includes finding and replacing selectively, case-sensitive searching, use of regular expressions, and forward and backward searching.

  • NEdit allows you to shift blocks of text or align text

  • NEdit offers a number of print options

  • NEdit allows you to customize your editing environment through the use of the Preferences menu and through the use of macros. Advanced features include execution of UNIX shell commands from within NEdit.

  • NEdit offers special features for programmers, including indentation, matching characters, and the use of tags files.

NEdit contains the following pulldown menus:

  • The File menu contains operations to let you work in NEdit files.l

  • The Edit menu lets you modify text in NEdit file.

  • The Search menu lets you identify a search target by highlighting text or by typing a string, singly or globally replace text, go to specified line numbers or selected text, mark locations, go to marked locations, and match characters (such as parentheses).

  • The Preferences menu lets you customize your NEdit environment.

  • The Shell menu lets you execute UNIX shell commands.

  • The Macro menu lets you map program keys and perform other advanced functions.

  • The Windows menu lets you customize the panes to split or full.

  • The Help menu contains files that explain how to work with NEdit.

NEdit operates in two different modes-Short Menus mode (the default) and Full Menus mode. In Short Menus mode, some commands are restricted (mostly shell scripts, macros, and some special features for programmers). These features are marked "Full Menus mode" in the help text.

To switch between the two modes, choose Preferences > Short Menus. You can find more information about Short Menus and Full Menus modes by clicking on the Help menu at the far right of the NEdit menu bar and selecting Customizing NEdit.

The remainder of this section contains the following topics:

Working with NEdit Files

With NEdit you can edit as many files at the same time as you wish. The File menu contains the following menu items:

New 

Opens a new file.

Open  

Opens an existing file.

Open Selected 

Opens a file whose name you have selected in your current window (Full Menus mode only).

Save 

Saves the file.

Save As 

Renames the file before saving it.

Revert 

Reverts to a previously saved version of the file.

Include File 

Inserts a specified file into the file you are editing.

Load Tags File 

Loads a tags file that was generated using the UNIX ctags command.

Print 

Prints the file to your default printer or any other specified printer. You can specify options such as number of copies, nondefault banner, paper size, and so on.

Close 

Closes the file.

Exit 

Exits NEdit.

The Edit menu lets you copy and paste and perform other functions that modify text. This menu contains the following items:

Undo 

Reverses any modifications that you make.

Redo 

Lets you change back to what you just undid.

Cut 

Lets you delete highlighted text and retains it in the paste buffer.

Copy 

Copies highlighted text to the paste buffer.

Paste 

Pastes text from the paste buffer.

Paste column 

Performs the same function as Paste.

Delete 

Lets you delete highlighted text by using the Delete key. Text is not retained in the paste buffer.

Select All 

Highlights all of the text.

Shift Left 

Shifts text to the left.

Shift Right 

Shifts text to the right.

Lower-Case 

Changes highlighted text to all lowercase.

Upper-Case 

Changes highlighted text to all uppercase.

Fill Paragraph 

Fills leading spaces within a paragraph.

Insert Form Feed 

 

Inserts a form feed character.

Insert Ctrl Code 

 

Inserts a Ctrl code.

Overtype 

Lets you type in overtype mode instead of insert mode.

Read Only 

Locks the file in read-only mode.


Tip: Pressing the right mouse button anywhere in the window opens a popup menu that contains the Undo, Redo, Cut, Copy, and Paste commands.


You can obtain more information on NEdit features from the Help menu at the far right of the NEdit menu bar.

Using Keyboard Shortcuts

NEdit lets you use control and function keys instead of pulling down menus with the mouse.The menu shortcuts are shown on the right side of the menus. For example, under the File menu, the “New” command is followed by Ctrl+ N. Hold down the Ctrl key and type N to invoke the “New command.” The letter you type is not case-sensitive, so you can type N or n.

There are other NEdit shortcuts that are not as obvious. With these, some of the letters you type are case-sensitive. You can find information about the following shortcuts by clicking on the Help menu at the far right of the NEdit menu bar and selecting Keyboard Shortcuts:

  • Menu Accelerators

  • Menu Mnemonics

  • Keyboard Shortcuts Within Dialog Boxes

  • Labeled Function Keys

  • Modifier Keys

  • PC Standard Keyboard

Moving Around in a NEdit File

The following topics describe procedures for moving around in a NEdit file:

Selecting Text with the Mouse

You can select text with either the left mouse button or the middle mouse button. In general, you use the left mouse button to position the cursor and make primary selections, and the middle mouse button to make secondary selections and to copy and drag the primary selection. Use the modifier keys (Shift, Ctrl, and Alt) to modify the actions. You can obtain details of the use of these buttons for selecting text from the Help menu at the far right of the NEdit menu bar and choosing Creating and Editing Text > Selecting Text With the Mouse.

Cutting and Pasting Text

To move text to a new location and delete it from the original site, use the following procedure:

  1. Select the text you want to delete.

  2. Choose Edit > Cut (Ctrl+X). The selection is moved to the clipboard (an invisible area that temporarily stores text and data).

  3. Place the cursor at the location at which you want the deleted text to appear and click the left mouse button.

  4. Choose Edit > Paste (Ctrl+V).

Copying Text with Menu Commands

To copy text to another location and leave the text at the original site, use the following procedure:

  1. Select the text you want to copy.

  2. Choose Edit > Copy (Ctrl+C). The selection is copied to the clipboard (an invisible area that temporarily stores text and data).

  3. Place the cursor at the new location at which you want the text to appear and click the left mouse button.

  4. Choose Edit > Paste (Ctrl+V).

Copying Text With Mouse Buttons

To copy text without using menu commands, use the following procedure:

  1. Position the cursor in the window in which you want the text to be copied (destination window) and click the left mouse button. This can be in any NEdit window. When you move the mouse outside the destination window, the cursor in the destination window changes to a caret sign.

  2. Position the cursor at the beginning of the text you want to copy, press the middle mouse button, and drag to the end of the text. The text is underlined as you drag. When you release the mouse button, the contents are copied to the location at which you clicked the mouse in step 1.

Moving and Copying Text By Dragging

To drag selected text to a new location in the file and leave the original text in place, use the following procedure:

  1. Select the text you want to copy.

  2. Place the cursor over the selected text, hold down the Shift key, press the middle mouse button, and drag the text to its new location.

To drag selected text to a new location in the file, removing it from the original location and overlaying the new location with the dragged text, use the following procedure:

  1. Select the text you want to copy.

  2. Place the cursor over the selected text, hold down the Ctrl key, press the middle mouse button, and drag the text to its new location.

Replacing Text

To replace text in a primary location with text from a secondary location and retain the text in the secondary location, use the following procedure:

  1. With the left mouse button, select the text you want to replace (primary selection).

  2. Move the cursor to the beginning of the text you want to insert (secondary selection) and select it by pressing the middle mouse button and dragging it to the end of the text. The text is underlined as you drag. When you release the mouse button, the secondary selection replaces the primary selection.

To replace text in a primary location with text from a secondary location and delete the text in the secondary location, use the following procedure:

  1. With the left mouse button, select the text you want to replace (primary selection).

  2. Move the cursor to the beginning of the text you want to insert (secondary selection), hold down the Shift key, and select the text by pressing the middle mouse button and dragging it to the end of the text. The text is underlined as you drag. When you release the mouse button, the secondary selection replaces the primary selection and the text in the secondary location is deleted.

Deleting Text

To delete text, select the text you want to delete and press Delete or Backspace, or choose Cut (Ctrl+X) from the Edit menu.

To delete text and replace it at the same time, select the text you want to replace and then begin typing. The text you enter replaces the selected text.

Finding and Replacing Text

NEdit has a number of commands for finding and replacing text. When you select either Find (Ctrl+F) or Replace (Ctrl+R), a dialog box pops up, in which you enter the text you want to search for or replace. You can choose whether you want the search to be sensitive to uppercase and lowercase or whether you want to use the standard UNIX pattern matching characters. You can also choose whether you want to search forward or backward in the document. The search begins at the cursor location. You can obtain details of finding and replacing text from the Help menu at the far right of the NEdit menu bar and choosing Creating and Editing Text > Finding and Replacing Text and Creating and Editing Text > Finding and Replacing Using Regular Expressions.

Finding a Location in a Document

You can find a location in a document from the Search menu by using one of the following methods:

  • Goto Line Number (Ctrl+E) (Full Menus mode). Locates the line number you enter in the dialog box. To show line numbers, click Statistics Line in the Preferences menu.

  • Goto Selected (Shift+Ctrl+E) (Full Menus mode). Locates a line number that you have selected in the text with the left mouse button. Goto Selected does not locate text. It expects a line number to be selected.

  • Mark (Ctrl+M a-z) (Full Menus mode). Marks the current selection or cursor position with a single letter that you enter in the dialog box. You then use the GotoMark command to recall the location.

  • Goto Mark (Ctrl+T a-z) (Full Menus mode). Locates the position of the letter marker that you set with the Mark command.

  • Match (..) (Shift+Ctrl+M) (Full Menus mode). Finds a matching character anywhere in the file. Matches {, (, [, <, ", `, `, /, and characters. NEdit does not match words.

  • Find Definition (Ctrl+D)(Full Menus mode). Finds function definitions in the code, based on information in a loaded tags file.

Setting Print Options

To print a file, choose File > Print. A Print dialog box appears. You can set the following general printing options in the Print Panel dialog box:

  • Choose a printer from the list of available printers. The default printer is highlighted.

  • Choose the number of copies.

  • Choose what you want printed on the banner page. A banner page is the first sheet of paper that the printer prints for each print job.

  • Choose whether you want to be notified when your job has finished printing.

For additional print options, click on the Help menu at the far right of the NEdit menu bar and select Printing.

Moving Around in Your Filesystem

When you are ready to open a file, you should use the Open option in the File menu. Using Open in the File menu gives you quick access to previously opened files. (Retyping the NEdit command in a shell and running additional copies of NEdit takes longer.) Using the File menu also ensures that you do not accidentally open the same file twice. It runs as long as at least one editor window is open.

When you choose File > Open (Ctrl+O) to open a file, the "File to Edit:" dialog box displays the directories and files in the current directory.

Select the file to open in the dialog box and click OK or simply double-click the filename. The file appears in another NEdit window.


Tip: In file selection dialog boxes, you can type the beginning characters of the filename or directory in the list and NEdit completes the filename. How much of the filename you need to enter is determined by the other filenames in the directory.

You can move around the filesystem in any of the following ways:

  • To move to a different directory, double-click the directory name or select it and press OK.

  • To navigate upward in the filesystem without typing the directory name, click the pathbar above the Selection field. Each bar represents a directory level.

  • To recall previously selected directories, click the button with the circular arrows to the right of the Selection field. It displays the directories whose contents you have previously displayed in the window.

  • To move directly to a directory, choose the File > Save As option and type the pathname in the Save File As: field. Pressing the space bar completes a partial directory or filename. If nothing matches, it beeps. Alternatively, you can drag an icon from the desktop and drop it in the drop pocket (small square) to the left of the Selection field.

Using Advanced Features in NEdit

NEdit offers a number of features especially designed for programmers, such as loading tags files, opening included files, and matching characters. Also offered are a number of advanced features, such as using X Window System resources, execution of UNIX shell commands from within NEdit, and running in server mode or through the NEdit client program, nc.

You can find more information about features for programmers and advanced features by clicking on the Help menu at the far right of the NEdit menu bar and selecting Features for Programmers or Advanced Features.

About jot

The jot editor is a fast, mouse-based, ASCII text editor tuned to run on Silicon Graphics workstations. jot offers the following features:

  • jot can edit very large files.

  • jot documents are saved as standard ASCII text files.

  • jot allows you to use the mouse to cut, copy, and paste text throughout the file. In addition, text can be cut and pasted between mail utilities and shell windows.

  • Any ASCII text file can be opened with jot, regardless of how it was created.

  • An entire text file can be inserted into a jot document.

  • jot has many features to help with C and C++ source code editing.

A row of five pulldown menus (plus a help menu) contain most of the commands you use every day.

  • The File menu contains operations to change the file you are editing, insert text from another file, print, save, and quit.

  • The Edit menu contains commands that copy and paste, and perform other commands that modify text.

  • The View menu contains commands that let you show line numbers and move around in your file.

  • The Select menu contains commands that make it easy to select, mark, and search text.

  • The Options menu contains commands that let you change the layout of your jot file.

  • The Help menu contains files that explain how to work with the jot editor. It also contains a very useful tutorial for jot users.

The remainder of this section contains the following topics:

Working with jot Files

The File menu contains most of the commands you need to change the file you are editing, insert text from another file, print, save, and quit. The File menu contains these choices:

New 

Opens a new file.

Open 

Opens an existing file.

Insert from file 

Inserts text from another file, such as another jot document, at the current text cursor location.

Save 

Saves your file.

Save as 

Lets you save your file as a new file with a different name.

Print 

Prints the file.

Quit 

Quits jot.

Using Keyboard Shortcuts

Most of jot's menu entries are followed by a special key name and then a letter. For example, under the File menu, the “New” command is followed by Alt + N. This is the keyboard shortcut. Hold down the Alt key and type n to invoke “New.” Do not capitalize the n unless the jot menu shortcut indicates that you should. For example, if the shortcut is Alt + capital N, jot lists the shortcut as Shift + Alt + N.

Printing Files

To print a file, choose “Print” from the File menu. The entire file (or the portion you select) is printed to your default printer.

Moving Around in a jot File

If the file is too long to be completely displayed in the window, a scroll bar appears on the right side of the document window. The white section in the scroll bar indicates the size and position of the selection. If your file contains fewer lines of text than there are available lines in the jot window, only the white section appears, and there is no scroll bar.

You can scroll your document several ways:

  • Use your left mouse button to drag the scroll bar up and down.

  • To scroll one line of text, click on a scroll arrow.

  • For a continuous scroll, press and hold a scroll arrow.

  • To scroll one full page of text, click on a scroll arrow while holding down the Shift key.

  • To jump to a relative position in the document, click within the scroll bar.

The View and Select menus contain commands that let you move around in your file.

The View Menu Commands

Top of File 

Moves the cursor to the top of the file.

Bottom of File 

Moves the cursor to the bottom of the file.

Page Up 

Moves up one page in the file.

Page Down 

Moves down one page in the file.

View Only 

Locks the file so it can be viewed but not edited.

Show Line Number 

Shows the number of each line in the file.

The Select Menu Commands

The Select menu commands make it easy to select, mark, and search text.

Select All 

Selects all of the text in the file.

Jump to Line 

Moves the cursor to the line in the file that you specify.

Search Forward 

Searches forward in the file from the cursor's location.

The Options Menu Commands

Wordwrap Lines
 

Automatically breaks words and continues them on the next line.

Automatic Indent
 

Indents the current line of text to begin at the same place as the line above it.

Search by Case
 

Allows you to search words with both initial and internal capitalization.

Long Menus
 

Changes the commands in the File, Edit, View, Select, and Options menus to include advanced commands. See “Using Advanced Features in jot” for information on the Long Menu features.

Editing a jot File

The Edit menu contains commands that copy and paste and perform other commands that modify text. You can display the Edit menu as a pop-up menu any place within the jot window by placing the cursor over the window and pressing the right mouse button.

These sections describe the other following functions available in jot:

Selecting Text in jot

You can select text three ways:

  • Hold down the left mouse button and drag the cursor over the desired text.

  • Click to position the cursor at the beginning of the desired selection, hold down the Shift key, and then click at the end of the selection.

  • Double-click on a word to select only that word.

The selected text appears highlighted.

Duplicating Text in jot

You can duplicate selected text in another location by using the middle mouse button. You can duplicate the selected text in either another jot document window or in a shell window.

To duplicate text:

  1. Select the text in the jot window.

  2. Position the text cursor in the application window where you would like the copy to appear.

  3. Press the middle mouse button.

A copy of the entire selection appears at the text cursor.

Using the Undo and Redo Commands

Choose the “Undo” command to undo the effect of the last action you performed. “Redo” reapplies the last action.

Using the Cut, Copy, and Paste Commands

Choose the “Cut” command to completely remove selected text and place it in a memory buffer.

To cut text:

  1. Select the text.

  2. Choose “Cut” from the Edit menu.

Choose the “Copy” command to copy selected text into the memory buffer. Copying text creates a second, identical version of the text and has no effect on the original text.

To copy text:

  1. Select the text.

  2. Choose “Copy” from the Edit menu.

Choose the “Paste” command to paste the contents of the memory buffer at the position of the text cursor. If the buffer is empty, choosing “Paste” has no effect. You may use the Paste command to paste into the same jot document from which you cut or copied, or into another jot document window.

You may also paste into a shell window by clicking the middle mouse button.

To cut or copy text and paste it into a new location:

  1. Select the text.

  2. Choose “Cut” or “Copy” from the Edit menu.

  3. Position the cursor where you want the text.

  4. Choose “Paste” from the Edit menu.

Using the Select All Command

Choose the “Select All” command to select the entire contents of your jot document.

Using the Insert File... Command

Follow these steps to insert a file into your jot document:

  1. Place the text cursor at the appropriate location within the jot document you are working on.

  2. Choose “Insert File...” from the File menu.

    A dialog box appears.

  3. Enter the pathname of the text file you want to insert.

  4. Click Insert.

    The text file is pasted into your document at the text cursor location.

Using Advanced Features in jot

Choose “Long Menus” from the Options menu to access the advanced editing features in jot. When you select “Long Menus,” more choices appear in each of the menus. What follows is a basic reference to the features that are added with the “Long Menus” option, including:

For more programming-oriented information on jot, its advanced features, and customization, see the jot reference page. You can also gain a better understanding of these features by opening the Help menu in jot and selecting “Tutorial.” After you open the tutorial, go to its “Advanced Topics” section.

Once you develop an awareness of the advanced menu commands you use often, you will find the keyboard shortcuts to be a quick option to actually using the menu. See “Using Keyboard Shortcuts” for more information.

The jot Long Menu File Commands

The jot long menu option adds four File menu choices: “Reopen,” “Reopen Next,” “Forget Reopen Entry,” and “Exit with no Save.”

Reopen 

Allows you to reopen recently opened files. This command triggers a rollover menu of filenames for you to choose from.

Reopen Next 

Reopens files in the order that you last opened them. For example, if you opened file A, then file B, then file C, and you are currently in file C, “Reopen Next” will reopen file A. If you choose “Reopen Next” again, file B will be opened.

Forget Reopen Entry 

Allows you to select files from a rollover menu; by selecting a file, you take it off of jot's “Reopen” list.

Exit with no Save 

Exits jot without saving your file. Unlike the “Exit” choice, this option does not prompt you to save your document before exiting.

The jot Long Menu Edit Commands

The jot long menu option adds nine Edit menu choices: “Append to Copy,” “Newline and Indent,” “Indent,” “Exdent,” “Transpose,” “Uppercase,” “Lowercase,” “Initial Caps,” and “Reformat.”

Append to Copy
 

Adds selected text to the current memory buffer. For example, if you select a sentence in a jot file, choose “Copy,” then select another sentence and choose “Append to Copy,” both sentences will appear when you use “Paste”.

Newline and Indent
 

Inserts a newline and indents it to match the previous line's indentation.

Indent
 

Indents current or selected lines by four spaces.

Exdent
 

Reverses indentation by four spaces.

Transpose
 

Transposes the characters on opposite sides of the cursor, or reverses selected characters.

Uppercase
 

Tranforms all letters in a text selection to uppercase.

Lowercase
 

Tranforms all letters in a text selection to lowercase.

Initial Caps
 

Capitalizes the first letter of a selection of text.

Reformat
 

Reformats block of selected text to the right margin. This command cleans up the ragged paragraphs that can develop as a result of having the “Wordwrap” feature turned off. Note that this feature does not align the text to the right margin, the text alignment will still be with the left margin.

The jot Long Menu View Commands

The jot long menu option adds two View menu choices: “Show Cut Buffer” and “Split Window.”

Show Cut Buffer
 

Shows you the material you last selected for the “Cut” command.

Split Window
 

Creates another jot session of the file you are currently using. The original window is reduced to half size and the new jot window is started directly below it. The new session is a “View Only” mode duplicate of the first one. You can cut from the “View Only” session and paste into the original session. Changes made to one window will not be reflected in the other.

The jot Long Menu Select Commands

The jot long menu option adds ten Select menu choices: “Select Line,” “Select Paragraph,” “Get Selection Info,” “Search Back,” “Search and Replace,” “Paste and Search,” “Set Mark,” “Delete Mark,” “Jump To Mark,” and “Jump To Tag.”

Select Line 

Selects the entire line in which the cursor is currently placed.

Select Paragraph 

Selects an entire paragraph of text. This occurs wherever the cursor is placed when the “Select Paragraph” command is invoked.

Get Selection Info 

Shows you the line number, character number, and column number of your text selection.

Search Back 

Searches backward in the file from the cursor's location.

Search and Replace 

Searches for and replaces character strings that you specify in a dialog box.

Paste and Search 

Replaces selected text with text in memory buffer, then searches forward for the character string you specify.

Set Mark 

Sets a mark at the location of your cursor. This mark is indicated in blue in the scroll bar to the right of your text.

Delete Mark 

Deletes the mark you set with “Set Mark.”

Jump to Mark 

Moves your cursor to the mark you set with “Set Mark.”

Jump to Tag 

Brings up your tags file, indicating the source code for the function you specify. This feature is for people who use the IRIX ctags command to create a tags file; jot can use the information in that file to access procedure names in C or C++ programs.

The jot Long Menu Options Commands

The jot long menu option adds eight Options menu choices: “Search Reopen List,” “Electric C Mode,” “Define Macro,” “Perform Macro,” “Save Macros,” “Filter,” “Shell Command,” and “Short Menus.”

Search Reopen List
 

When this feature is turned on, the “Search” mechanism searches for specified character strings in all the files in your current Reopen list.

Electric C Mode
 

Helps you type C or C++ source code by making some adjustments to your current jot session. These are the basic Electric C Mode characteristics:

  • Tab size is set to four spaces.

  • “Wordwrap Lines” is turned off.

  • “Automatic Indent” is turned on.

  • Parentheses, brackets, and quotes are automatically matched on the next line.

  • Every comma that you type is automatically followed by a space.

  • The definition of what makes up a word is slightly altered to meet C and C++ programming needs. For example, the underscore character is part of a word in Electric C Mode.

Define Macro
 

Programs any user-specified sequence of keystrokes into the F1 through F12 keys. You choose which “F” key to define from the “Define Macro” rollover menu. After you choose the key, type in the definition you want. Then, go back to the Options menu and select “End Macro Definition.”

Perform Macro
 

Performs the macro of your choice, which you select from the “Perform Macro” rollover menu.

Save Macros
 

Saves all your current defined macros to your ~/.jotmacs file. Every time you open jot, the .jotmacs file is read.

Filter
 

Allows you to apply an IRIX command to a selected section of text. For example, you could use “Filter” to apply the sort command to a text list. The sorted list will then be stored in your “Cut” buffer. To replace the old list with the sorted list, use the “Paste” command.

Shell Command
 

Allows you to apply an IRIX command to a selection of text, which is printed out in your console window. The original text selection stays the same, but the console printout of your selected text reflects the command you entered.

Short Menus
 

Changes jot's menus to the shortened versions, which leave out the more advanced commands.