Using Text EditorThis chapter describes how to create and edit short
documents such as memos, mail messages, or resource files using Text Editor.documentrestoringdocumenteditingtexteditingeditingtext or documentOpening and Closing Text EditorText EditorstartingThere are several ways to start Text Editor from your desktop.To Open Text EditorClick the Text Editor control
in the Front Panel.Text EditorFront
Panel controlFront PanelText Editor controlOr, open
the Personal Applications subpanel in the Front Panel and click the Text
Editor control.Text Editor can also be started from the command line by typing this
command in a Terminal window:dtpad filename &The file name is optional.To Close Text EditorText EditorclosingChoose Close from the File menu or press Alt+F4.
If your keyboard does not have an Alt key, ask your system administrator
to identify the corresponding key.Text Editor WindowText EditorwindowYou create and edit a document in the Text Editor window. The title
bar displays the name of the current document. A new document is named (UNTITLED).
Text Editor windowYou can optionally display a status line that reports the number of
lines in your document and enables you to go to a specific line number.To Display the Status Linestatus linein Text Editor windowText Editorstatus lineThe status line displays the line number where the insertion cursor
is located and the total number of lines in the document. It also reports
Text Editor messages and indicates whether Overstrike mode is active.Choose Status Line from the Options menu. To
remove the status line, choose Status Line again from the menu.Opening and Saving DocumentsText Editoropening documentText Editorsaving documentYou can create a new document or open an existing document. Opening
a document displays the contents of a selected file in the Text Editor window.
Saving a document stores the edited contents into a file. You can save
a document to its original file or to a new file.To Create a New DocumentA new document named (UNTITLED)is create d when you start Text Editor.documentcreatingcreatingdocument To enter text in your
document, see . You provide a new file
name when you save the document.After finishing a document, you can create another document using the
New command.Choose New from the File menu.The Text Editor window is cleared and a new document is created. If
you have not saved your current document, a dialog box is displayed that
enables you to save your document.To Save a Document to a New Filedocumentsavingsavingdocument to new fileText Editorsaving document to new fileChoose Save As from the File menu.The Save As dialog box lists files and folders located in your current
folder. You can store your document in the current folder, a subfolder, or
a folder that you specify.If you used Wrap To Fit, the dialog box includes an additional choice
about handling line endings. If Wrap To Fit is not set, the dialog box omits
this choice (see ).
Save As dialog boxOptional. If you do not
want to save the file to the current folder, choose a subfolder or indicate
a different folder.For a subfolder, select the
subfolder in the Folders list and press Return.For a different folder, use the .. (go up) icon
to change to a folder or type its path name in the Enter path or folder name
field.Type a new file name in the Enter file name field.
Press Return or click OK.To Save a Document to the Original FileText Editorsaving document to original filesavingdocument to original fileChoose Save from the File menu to save your work
and continue editing your document.If you used Wrap To Fit, the Save dialog box includes an additional
choice about handling line endings (see ).
Opening an Existing DocumentYou can open an existing document in these ways:documentopening existing <$startrange>openingexisting document <$startrange>Open the document in Text Editor.
Select the file icon in File Manager and choose
Open from the File Manager Selected menu.Double-click the file icon in File Manager.Drag the document's file icon to the Text Editor
control in the Front Panel.To Open an Existing Document from Text EditorChoose Open from the File menu.The Open a File dialog box lists files and folders in your current folder.
You can browse the documents listed, or change to a new folder to locate
other files on your system.Open a File dialog boxSelect the name of the document you want to open,
or type the document name in the Enter file name field.Press Return or click OK.You can also use this shortcut: double-click the document name in the
dialog box.To Open an Existing Document from File ManagerDisplay the document's file icon in a File Manager
window.documentopening existing
from File ManagerFile Manageropening existing text document fromDocument file iconOpen the document in one
of the following ways:Double-click the document.Select the document, then choose Open from the
File Manager Selected menu.Drag the document file icon
to the Front Panel and drop the icon on the Text Editor control.documentopening existing <$endrange>openingexisting document <$endrange>Entering TextText Editorentering texttextenteringAs you create a document, you type and edit text. A cursor ( I) shows your current position. Characters are inserted unless
you set Overstrike mode (see ).
To Enter New TextClick in the document and start typing.To start a new line, press Return. Or, you can use the Wrap To Fit option
to automatically wrap text at the edge of the window.To start a paragraph, press Return twice.Using Wrap To FitWrap To Fit controls whether lines are automatically wrapped to fit
the width of the window. When Wrap To Fit is set on, lines are broken automatically
at the edge of the window. Because these line breaks are dynamic, you can
resize the Text Editor window and thedocumentnew lines in text automatically adjusts
to fit the new window width.When you save your document, you decide whether to add a line break
to each of the wrapped lines, or to retain the dynamic line endings. When
you save your document, you choose one of these options:Add a newline character (hard
return) to the end of each wrapped line to preserve each line ending as it
currently appears.Or, preserve only line breaks
that were created by pressing Return.To Set Wrap To Fit On or OffText Editorword wrapText EditorWrap To Fit optiontextautomatic wrappingdocumentword wrapword wrapWrap to Fit, turning on and offTo set Wrap To Fit on, choose the Wrap To Fit
toggle button in the Options menu. To set Wrap To Fit off, choose the toggle
button again.Entering Special CharactersText Editorspecial characters andspecial charactersin Text EditorDifferent systems often use certain key combinations to insert special
characters. In some instances, a key combination may be reserved by Text
Editor. For example, a Text Editor mnemonic for displaying a menu might
conflict with a key sequence you want to use on your keyboard.To insert the correct character you may need to override the reserved
behavior by preceding the key combination with Control+Q.Moving the Cursor in a DocumentText Editorcursor keysAs you enter and edit text, you move the insertion cursor using the
mouse and keyboard cursor keys. Using the mouse, move the pointer to the
new location in the document and click mouse button 1.navigatingmoving text insertion cursorYou can also use the keyboard cursor movement keys:keyboardcursor movement keys in Text Editorcursor movement keysKeyCursor MovementUp ArrowUp one lineDown ArrowDown one lineLeft ArrowLeft one characterRight ArrowRight one characterControl+Left Arrow
Move left to previous wordControl+Right Arrow
Move right to next wordHomeBeginning of the current lineEndEnd of the current lineControl+Up
ArrowBeginning of the previous paragraph
Control+Down Arrow
Beginning of the next paragraphControl+HomeBeginning of the documentControl+EndEnd of the documentControl+GTo the Line field in the status line
If your keyboard uses different key labels, ask your system administrator
to identify the corresponding keys.To Go to a Specific Linedocumentgoing to specific line innavigatingto specific line in documentDisplay the status line (see ).Press Control+G or click in the Line field of the
status line.Type the line number you want to go to and press
Return.To Scroll a DocumentSelect and drag the vertical scroll bar to view
more text. Use the horizontal scroll bar to view long lines.You can also use the scrolling keys:KeyScroll MovementPage UpUp one pagePage DownDown one pageControl+Page UpLeft one pageControl+Page DownRight one pageSelecting Textselection, in Text EditorselectingtexttextselectingBefore using edit commands such as cut and paste, you must select the
text. You can select text using the mouse or the keyboard.To Select Text with the MouseClick at the beginning of the text you want to
select.Press and hold mouse button 1 and drag to the
end of the text.To deselect text, click any area in the window.To modify a selection you have made, press and hold the Shift key and
mouse button 1. Then drag forward or backward to adjust the amount of selected
text. Or, hold down the Shift key and one of the arrow keys to change the
selection.You can also use these shortcuts for selecting text:WordDouble-click the wordLineTriple-click the lineAll textQuadruple-click in the textSecondary SelectionThis method enables you select text and replace it with another selection,
which is used as the replacement text.To Replace Text Using Secondary SelectionSelect the text that you want to replace.Move the pointer to the beginning of the text you
want to replace the first selection with. Hold down the Alt key and mouse
button 2 and drag to the end of the text you want to use.The text is underlined.If your keyboard does not have an Alt key, ask your system administrator
to identify the corresponding key.Release the Alt key and mouse button.The underlined text overwrites your first selection.To Select Text with the KeyboardText to SelectActionText blockMove the cursor to the beginning of
the text block. Hold down the Shift key and an arrow key
to move the cursor to the end of the text block.Cursor to beginning of lineShift+HomeCursor to end of lineShift+EndCursor to beginning of paragraphShift+Control+Up ArrowCursor to end of paragraphShift+Control+Down ArrowCursor to beginning of documentShift+Control+HomeCursor to end of documentShift+Control+EndAll textControl+/Deselect all textControl+\Editing TextMinor edits can be made using the editing keys. You may also want to
copy, move, or delete portions of text, find and change a word or phrase,
or check the spelling of your document.Editing KeysText Editorediting keysKeyActionBackspaceDeletes the character before the cursor
DeleteDeletes the character following the
insertion cursorControl+BackspaceDeletes the previous wordShift+BackspaceDeletes characters from the cursor
to the beginning of the lineControl+Delete (Control+Remove)Deletes all the characters from the
cursor to the end of the current lineInsertToggles Overstrike and Insert mode
Note that not all vendors' keyboards supply these keys.
Please see your local vendor's documentation for alternate key bindings.
Menu Shortcut KeysText Editormenu shortcut keysshortcut keysin Text EditorYou can also use these shortcut keys when making edits.Control+CCopy selected textControl+XCut selected textControl+VPaste selected textControl+FFind/Change textControl+ZUndo a cut, delete, clear, include,
copy, or paste commandUNIX Key BindingsText EditorUNIX (Emacs) key bindingsUNIXTM key bindings enable you to use a set
of extended Emacs keys, such as Alt+B (back word) or Control+N (next line),
in Text Editor. To enable UNIX key bindings (which are set off by default)
you edit a file in your home directory.To Enable UNIX Key BindingsUNIX key bindingsAdd the following line to the .Xdefaults file in your home directory:#include “/usr/dt/app-defaults/language/UNIXbindings”
Replace language with the name of your
language environment.If the .Xdefaults file does not exist,
create the file in your home directory.Log out of your current session.Log in and restart Text Editor.Some Text Editor menu accelerators conflict with UNIX key bindings.
When UNIX key bindings are enabled, Text Editor provides alternate menu
accelerators for these commands:CommandAlternate Menu AcceleratorFind/Change (Control+F)Control+SPaste (Control+V)Shift+InsertPrint (Control+P)no alternate acceleratorUndo (Control+Z)Control+_If you want to modify these menu accelerators, copy the contents of
the /usr/dt/app-defaults/language/UNIXbindings file into
your .Xdefaults file and then make your
changes.When using UNIX key bindings, the Delete key deletes the previous character
rather than the character that follows the cursor.To Set Overstrike Modeoverstrike mode, in Text EditorAs
you type, new characters are inserted. If you want to type over existing
characters, change to Overstrike mode.Choose Overstrike from the Options
menu. To return to Insert mode, choose Overstrike again from the menu.Or, use the Insert key to
switch between Insert and Overstrike mode.When Overstrike mode is on, the cursor changes to a block. If
you use Overstrike mode often, you may want to display the status line (see
) because it indicates whether Overstrike mode is
on or off.To Type Over TextSelect the text.Type the replacement text.You can also choose Overstrike from the Options menu to turn off Insert
mode and type over the text directly.To Delete TextdeletingtexttextdeletingSelect the text.Choose Delete from the Edit menu or press the Delete
key.Deleted text cannot be pasted, but it can be recovered with the Undo
command (see ).If you intend to paste the text that you delete, use the Cut command
(see ).To Clear TextThe Clear command replaces the selected text with spaces or blank lines.
Select the text to be cleared.Choose Clear from the Edit menu.To Undo an EditText Editorusing Undo inUndo, in Text EditorChoose Undo from the Edit menu or press Control+Z.
Undo reverses the last cut, paste, clear, delete, change, include, or
format operation.To Copy TextcopyingtexttextcopyingSelect the text to be copied.Choose Copy from the Edit menu or press Control+C.
A copy of the text is stored on a clipboard where it can be accessed
or replaced by other applications.Click where you want to insert the text.Choose Paste from the Edit menu or press Control+V.
You can also use drag and drop to copy text (see ).
Use this shortcut to copy a word or phrase: Select the text, move the
pointer to where you want to insert the text, and click mouse button 2. This
is a quick way to copy text into a dialog box.To Move Text (Cut and Paste)textcutting and pastingSelect the text.Choose Cut from the Edit menu or press Control+X.
The text is erased from the document and stored on a clipboard where
it can be accessed or replaced by other applications.Move the cursor to where you want to insert the
text.Choose Paste from the Edit menu or press Control+V.
You can also use drag and drop to move text (see ).
To Correct Misspelled Wordsspelling, correcting in Text EditorChoose Check Spelling from the Edit menu.The Spell dialog box lists misspelled or unrecognized words.Spell dialog boxSelect the misspelled word in the Misspelled
Word list that you want to find and press Return. Or, just double-click the
word.The next occurrence of the word is highlighted in your document.Type the correct word into the Change To field.
Click Change to correct a single occurrence.To find and change additional occurrences, click
Find and then Change.Or, click Change All to replace all occurrences.
Click Close when you are done.The Check Spelling feature is only available for the English language.
To Include a Filedocumentincluding file infilesincluding in Text Editor documentYou can insert a text file into your document using a menu command or
by dragging a file icon into the Text Editor window (see ).
Position the cursor where you want to insert
the text file.Choose Include from the File menu.The Include a File dialog box lists files and folders on your system.
You can browse the documents listed, or change to a new folder to locate
other files on your system.Include a File dialog boxSelect the document you want to insert in the
Files list.Press Return or click OK.Using Drag and DropText Editordrag and drop intextdraggingtextdroppingdraggingtextdroppingtextfilesdropping in Text Editor documentfilesincluding in document through drag and dropdocumentincluding file through drag and dropdrag and drop, in Text EditorYou can use drag and drop to move or copy text between Text Editor
documents or other applications. You can also include a file into your document
using drag and drop.To Move Text Using Drag and DropSelect the text that you want to move.With the pointer on the selection, press and hold
mouse button 1, and drag to where you want to insert the text.Release the mouse button.The text is inserted into your document relative to the position of
the drag icon.To Copy Text Using Drag and DropSelect the text you want to copy.With the pointer on the selection, press and hold
the Control key and mouse button 1, and drag to where you want to copy the
text.Release the Control key and mouse button.The text is copied relative to the position of the drag icon.To Include a File Using Drag and Dropdraggingfile to Text Editordroppingfile in Text EditorWhen using drag and drop, the contents
of the file are copied into the Text Editor window at the position of the
insertion cursor. The original file remains intact.Click in your document where you want to include
the file.Drag the file icon that you want to include into
the Text Editor window.Searching a Documentdocumentsearchingsearch and replace, in Text EditorYou can search for a word or phrase in your document. The Find command
begins from the position of the insertion cursor and proceeds through the
entire document. You can automatically replace or delete occurrences found
in your document.Searches are case sensitive. To find all occurrences, search for both
lowercase and uppercase instances.To Find Texttextfinding in Text EditorChoose Find/Change from the Edit menu or press
Control+F.Find/Change dialog boxType the text you want to find in the Find field.
Press Return or click the Find button to locate
the next occurrence of the text.To find additional occurrences, press Return or
click Find again.To Find and Change TextChoose Find/Change from the Edit menu or press
Control+F.Type the text you want to find in the Find field.
Type the replacement text in the Change To field.
Press Return or click the Find button to locate
the next occurrence of the text.Click Change to replace a single occurrence.To find and change additional occurrences, click
Find and then Change.Or, click Change All to replace all occurrences.
There is no Undo for Change All.Click Close when you are done.To Find and Delete TextChoose Find/Change from the Edit menu or press
Control+F.Type the text you want to delete in the Find field.
Leave the Change To field blank.Press Return or click Find to locate the next occurrence.
Click Change to delete a single occurrence.To find and change additional occurrences, click
Find and then Change.Or, click Change All to replace all occurrences.Click Close when you are done.Formatting and Printing DocumentsText Editorformatting document informattingdocument in Text EditordocumentformattingOnce your editing is complete, format your document by choosing margins
and text alignment.To Format a DocumentText Editorformatting document inmargins, documentdocumentmarginsjustification, setting in Text Editordocumentjustifying text intextjustifyingChoose Settings from the Format menu.Format Settings dialog boxEnter margins.The default left margin is 0 and the right margin is dynamically set
to the width of the Text Editor window. Margins are specified as a number
of character columns.Select left, right, justify (block style), or center
alignment.textalignmentDetermine the scope of the formatting:To format a single paragraph,
place the cursor in the paragraph, then click Paragraph.To format the entire document, click All.After closing the dialog box, choose Paragraph
or All from the Format menu to apply the settings.To Print an Open Document with Default OptionsText Editorprinting document with default optionsprintingdocument with default optionsdocumentprinting with default optionsOpen the document in Text Editor.Choose Print from the File menu.
To Print an Open Document with Specific OptionsText Editorprinting document with specific optionsprintingdocument with specific optionsdocumentprinting with specific optionsOpen the document in Text Editor.Choose Print... from the File menu or press Control+P.
The Print dialog box appears.
Print dialog boxTo select a different printer,
type the new printer name in the Printer Name field.To output multiple copies, type
the number of copies in the Copies field.
To print to a file, click the Print to File checkbox
and type the path and filename for the file.
To have long lines wrap to fit the page size,
click the Use Word Wrap checkbox.
To set the margins
for the printed output, type the desired values in the Top, Left,
Right, and Bottom fields. You can specify margin values in
inches (in), centimeters (cm), or pixels (pi).
The default value for all margins is one inch.
If no unit value is specified, pixels are used.
Your margin settings remain in effect until you change them. They are used when you
print with default options.
To include headers and/or footers on the printed output,
choose the type of information you want for Top Left, Bottom Left,
Top Right, and/or Bottom Right. For each position, you can select:
Date, to display the current date.
Document Name, to display the name of the document being printed.
Page Number, to display page numbers.
User Name, to display your user name.
None, to display nothing.
The following defaults are used:
Top Left—None
Top Right—Document Name
Bottom Left—None
Bottom Right—Page Number
Your header and footer settings remain in effect until you change
them. They are used when you print with default options.
To set printer-specific options, click the Setup... button on the Print dialog box.
The Print Setup window appears. From this window, you can access
both Printer and Job options.
Print Setup windowThe Printer options dialog box lets you control such items as page orientation
(portrait or landscape), page size (legal, letter, etc.), one- or two-sided
printing, and which printer tray to use.
The Job options dialog box lets you indicate whether
you want an email notification sent when your print job completes and
what text (if any) you want to appear on the banner page. You can also
specify print command options in the Print Command Options field.
When finished with the Print Setup window, click OK to set your changes
and return to the Print dialog box.
Your Print Setup settings remain in effect until you change
them. They are used when you print with default options.
To send the open document to the printer from the
Print dialog box, click Print.To Print a Closed DocumentDisplay the document's file icon in File Manager.
Drag the file icon to the Printer control in the
Front Panel.The Print dialog box is opened.Optional. Set printing options.
Click Print.Recovering a FilerestoringText Editor fileIf Text Editor is interrupted due to a system error, it attempts to
save your changes in a recovery file in your current folder. The recovery
file is named #filename#, where filename is the name of the document. If you had never named your
document, the recovery file name is #UNTITLED#.To Recover a FileStart Text Editor.Open the recovery file.Save the document using your original file name
or provide a new name for a previously unsaved document.Text Editor and Other ApplicationsText Editorused in other applicationsapplicationsusing Text Editor withOther applications can use Text Editor as a tool to edit documents or
other types of information. Under certain conditions, an application may
choose to restrict your editing choices. In the example below,
the File menu has been modified. The Save As command has been replaced with
a Copy To File command and the New and Open commands are not available.Text Editor with modified File menu