.TH xedit "" "" "X Client"
.PC "Simple text editor for X"
\fBxedit [\-\fItoolkitoption ... \fB] [\fIfilename\^\fB]\fR
.PP
.HS
.SH Options:
.IC \fIfilename\fR
A file to edit
.IC "\fB\-bd \fIcolor\fR"
Set the color of the border to \fIcolor\fR
.IC "\fB\-bg \fIcolor\fR"
Set the color of the background to \fIcolor\fR
.IC "\fB\-bw \fIpixels\fR"
Set the width of the border to \fIpixels\fR
.IC "\fB\-display \fIhost\^\fB[:\fIserver\^\fB][.\fIscreen\^\fB]\fR"
Display the client's window on screen number \fIscreen\fR
of \fIserver\fR on host system \fIhost\fR
.IC "\fB\-fg \fIcolor\fR"
Set the color of the foreground to \fIcolor\fR
.IC "\fB\-fn \fIfont\fR"
Use \fIfont\fR in the display
.IC "\fB\-geometry \fIgeometry\fR"
Set the geometry of the program's window to \fIgeometry\fR
.IC \fB\-rv\fR
Simulate reverse video by exchanging the foreground and background colors
.IC "\fB\-xrm \fIresourcestring\fR"
Use \fIresourcestring\fR to define a resource
.HE
.B xedit
is a simple text editor that works directly under X.
When you invoke
.BR xedit ,
it displays a window that contains the following four areas:
.IP "\fBCommands\fR" 0.75i
A set of buttons that allow you to exit
.BR xedit ,
save the file, or load a new file into the edit window.
.IP "\fBMessages\fR"
Messages from
.BR xedit .
In addition, you can use this window as a scratch pad. 
.IP "\fBFilename\fR"
The name of the file being edited,
and whether it is \fBRead-Write\fR or \fBRead Only\fR.
.IP "\fBEdit\fR"
The text of the file that you are editing or creating.
.SH Options
.I filename
names the file to edit.
If you do not name a file,
.B xedit
lets you load or create file after it has started up.
.PP
.B xedit
recognizes the following command-line options:
.IP "\fB\-bd \fIcolor\fR" 0.75i
Set the color of the border to
.IR color .
.IP "\fB\-bg \fIcolor\fR"
Set the color of the background to
.IR color .
.IP "\fB\-bw \fIpixels\fR"
Set the width of the border to
.IR pixels .
.IP "\fB\-display \fIhost\^\fB[:\fIserver\^\fB][.\fIscreen\^\fB]\fR"
Display the client's window on screen number
.I screen
of
.I server
on host system
.IR host .
.IP "\fB\-fg \fIcolor\fR"
Set the color of the foreground to
.IR color .
.IP "\fB\-fn \fIfont\fR"
Use
.I font
in the display.
.IP "\fB\-geometry \fIgeometry\fR"
Set the geometry of the program's window to
.IR geometry .
The term ``geometry'' means the dimensions of the window and its location
on the screen.
.I geometry
has the form \fIwidth\(muheight\(+-xoffset\(+-yoffset\fR.
.IP \fB\-rv\fR
Simulate reverse video by exchanging the foreground and background colors.
.IP "\fB\-xrm \fIresourcestring\fR"
Use
.I resourcestring
to define a resource.
.SH Editing
.B xedit
uses the Athena Text widget for the three sections that allow text input.
The characters typed go into the Text widget that the mouse cursor is over.
If the mouse cursor is not over a text widget,
then keystrokes do nothing.
This is also true for the special key sequences that pop up dialogue widgets,
so typing
.B <ctrl-S>
in the file-name widget enables searching in that widget, not the edit widget.
.PP
Both the message window and the edit window create a scrollbar if
the mass of text to display is too large to fit within that window.
Horizontal scrolling is not allowed by default,
but can be turned on through the Text widget's resources.
.PP
.BR xedit 's
default keystrokes closely resemble those of the \*(ME editor.
The default keystrokes are as follows:
.IP \fB<ctrl-A>\fR 0.75i
Move the cursor to the beginning of the current line.
.IS \fB<ctrl-B>\fR
Move the cursor one character to the left.
.IS \fB<ctrl-D>\fR
Delete the next character.	
.IS \fB<ctrl-E>\fR
Move the cursor to the end of the line.	
.IS \fB<ctrl-F>\fR
Move the cursor forward by one character.
.IS \fB<ctrl-G>\fR
Multiply reset.	
.IS \fB<ctrl-H>\fR
Delete one character to the left.
.IS \fB<ctrl-J>\fR
Newline and indent.
.IS \fB<ctrl-K>\fR
Kill text from the cursor to the end of the line.
.IS \fB<ctrl-L>\fR
Redraw the display.
.IS \fB<ctrl-M>\fR
Newline.
.IS \fB<ctrl-N>\fR
Move the cursor to the next line.
.IS \fB<ctrl-O>\fR
Newline and backup.
.IS \fB<ctrl-P>\fR
Move the cursor to the previous line.
.IS \fB<ctrl-R>\fR
Search and replace backwards.	
.IS \fB<ctrl-S>\fR
Search and replace forward.	
.IS \fB<ctrl-T>\fR
Transpose two characters.
.IS \fB<ctrl-U>\fR
Multiply an argument by four.
.IS \fB<ctrl-V>\fR
Display the next pageful of text.
.IS \fB<ctrl-W>\fR
Kill selection.
.IS \fB<ctrl-Y>\fR
Yank text \(em copy back text that had been killed.
.IS \fB<ctrl-Z>\fR
Scroll one line up.
.IS \fB<esc>B\fR
Move the cursor one word to the left.
.IS \fB<esc>F\fR
Move the cursor one word to the right.
.IS \fB<esc>I\fR
Insert a file.
.IS \fB<esc>K\fR
Kill to end of the current paragraph.
.IS \fB<esc>Q\fR
Form a paragraph.
.IS \fB<esc>V\fR
Display the previous page of text.
.IS \fB<esc>Y\fR
Insert the current selection (i.e., text you have cut with the mouse).
.IS \fB<esc>Z\fR
Scroll one line down.
.IS \fB<esc>D\fR
Delete the next word to the right of the cursor.
.IS \fB<esc>D\fR
Kill the next word to the right of the cursor.
.IS \fB<esc>H\fR
Delete the word to the left of the cursor.
.IS \fB<esc>H\fR
Kill the word to the left of the cursor.
.IS \fB<esc><\fR
Move the cursor to the beginning of the file.
.IS \fB<esc>>\fR
Move the cursor to the end of the file.
.IS \fB<esc>]\fR
Move the cursor forward by one file.
.IS \fB<esc>[\fR
Move the cursor to the beginning of the previous paragraph.
.IS \fB<esc><del>\fR
Delete one word to the left of the cursor.
.IS \fB<esc><shift><del>\fR
Kill one word to the left of the cursor.
.IS \fB<esc><backspace>\fR
Delete one word to the left of the cursor.
.IS \fB<esc><shift><backspace>\fR
Kill one word to the left.
.PP
.II cut
.II paste
In addition, you can use the X system's default cut-and-paste feature,
as follows:
.DS
.ta 0.5i 2.25i
	\fBLeft Button Down\fR	Start selection
	\fBLeft Button Motion\fR	Sweep out selection
	\fBLeft Button Up\fR	End selection (i.e., cut)
.sp \n(pDu
	\fBMiddle Button Down\fR	Insert current selection (paste)
.sp \n(pDu
	\fBRight Button Down\fR	Extend current selection
	\fBRight Button Motion\fR	Adjust selection
	\fBRight Button Up\fR	End selection (cut)
.DE
.PP
.II emulate3buttons
If your mouse has only two buttons, press both buttons to mimic the
middle mouse button.
Note that this only works if you have un-commented the line
.B emulate3buttons
in the file
.BR /usr/X11/lib/Xconfig .
.SH Commands
.BR xedit 's
commands window has the following buttons:
.IP \fK(Quit)\fR
Quit the current editing session.
If you have modified the file since you last saved it,
.B xedit
displays a warning message and gives you a chance to save it.
.IP \fK(Save)\fR
If file backups are enabled (see
.BR Resources ,
below),
.B xedit
stores a copy of the original, unedited file in
\fB<prefix>\fIfile\fB<suffix>\fR,
then overwrites the
.I file
with the contents of the edit window.
The file name is retrieved from the Text widget directly to the right of the
.B Load
button.
.IP \fK(Load)\fR
Load the file named in the text widget immediately to the right
of the this button and display it in the
.B Edit
window.
If the currently displayed file has been modified, a warning message asks
you to save the changes or press
.B Load
again.
.SH Resources
.B xedit
uses the following resources:
.IP "\fBenableBackups (\fRClass\fB EnableBackups)\fR"
Ask
.B xedit
to save the original version of a file into  \fB<prefix>\fIfile\fB<suffix>\fR
before it saves changes to the file being edited.
The default value for this resource is
.BR off ,
stating that no backups should be created.
.IP "\fBbackupNamePrefix (\fRClass\fB BackupNamePrefix)\fR"
Name the string that
.B xedit
prefixes to the name of the backup file.
The default is
.BR .BAK .
.\".SH Widgets
.\"The following gives the hierarchy of the widgets that
.\".B xedit
.\"uses:
.\".DM
.\"Xedit  xedit
.\"	Paned  paned
.\"		Paned  buttons
.\"			Command  quit
.\"			Command  save
.\"			Command  load
.\"			Text  filename
.\"		Label  bc_label
.\"		Text  messageWindow
.\"		Label  labelWindow
.\"		Text  editWindow
.\".DE
.SH Environment
.B xedit
reads the following environmental variables:
.IP \fBDISPLAY\fR
The default host and display number.
.IP \fBXENVIRONMENT\fR
The name of a resource file that
overrides the global resources stored in the property
.BR RESOURCE_MANAGER .
.SH Files
\fB/usr/X11/lib/app-defaults/Xedit\fR \(em Required resources
.SH "See Also"
.B
X clients,
xrdb
.R
.SH Notes
Copyright \(co 1988, Digital Equipment Corporation.
.PP
Copyright \(co 1989, Massachusetts Institute of Technology.
.PP
.II "Peterson, Chris"
.B xedit
was written by Chris Peterson of the MIT X Consortium.
