man xed (Commandes) - text editor for X

NAME

xed - text editor for X

SYNOPSIS

xed [-s] [-p string] [-nb] [-P] [-ttymode] [-fn font] [-x N] [-nsb] [-help] [-version] [file]

DESCRIPTION

Xed is the standard text editor, conveniently re-written for use in the standard windowing system.

Xed is a completely backward-compatible implementation of the ed line-oriented text editor. See the ed(1) manual page for a description of the basic ed syntax and command set; what follows is a description of the features unique to xed.

OPTIONS

-s
Suppresses diagnostics.
-p string
Specifies a command prompt. This may be toggled on and off with the `P' command.
-nb
Turns off automatic file backup. By default, xed will back up a file to filename~ before writing to that file.
-P
Causes xed to start up in playback mode. In this mode, xed reads lines from stdin (usually fed from an ed-style patch or script), places them sequentially in the GUI command buffer, and waits for the user to hit <Return> in the window before proceeding. This allows a user to "step through" an ed script and observe the results.
-ttymode
Prevents xed from connecting to the X server and creating an X window. In this mode, xed's interface closely emulates the original ed. Note, however, that the tty interface is available when there is an X window, as well.
-fn font
Sets the font to use in the X window. Defaults to "fixed".
-x N
Sets tab stops at every N spaces in the X window. Defaults to 8.
-nwl
Prevents long lines from being wrapped in the GUI, and truncates them instead.
-nsb
Disables the scroll bar in the X window.
-help
Print a usage message on stdout and exit successfully.
-version
Print version information on stdout and exit successfully.
file
Specifies the name of a file to read. If given, the first command executed by xed is "e file".

RESOURCES

As a Tk-based application, Xed understands all the standard X Toolkit resources, as well as the standard wish resources, in particular those relating to the Text, Entry, Label, and Scrollbar widgets.

In addition, the application supports the following set of X resources. For an example of usage, see the file rvideo.xrdb in the distribution.

tabWidth (class TabWidth)
Specifies the same thing as the -x command line option: set tab stops every N characters.
wrapLines (class WrapLines)
A boolean "on" or "off" value, which specifies whether to wrap or truncate long lines in the GUI. Corresponds to the -nwl command line option.
scrollbar (class Scrollbar)
A boolean "on" or "off" value, which determines whether the scrollbar is displayed. Corresponds to the -nsb command line option.
currentForeground (class Foreground)
Specifies the foreground color of the current line.
currentBackground (class Background)
Specifies the background color of the current line.
subcmdForeground (class Foreground)
Specifies the foreground color of the current line while executing a `G' or `V' command.
subcmdBackground (class Background)
Specifies the background color of the current line while executing a `G' or `V' command.
rangeForeground (class Foreground)
Specifies the foreground color of the lines selected by the current command.
rangeBackground (class Background)
Specifies the background color of the lines selected by the current command.
destForeground (class Foreground)
Specifies the foreground color of the destination line selected by an `m' or `t' command.
destBackground (class Background)
Specifies the background color of the destination line selected by an `m' or `t' command.
insertForeground (class Foreground)
Specifies the foreground color of the input line while in input mode.
insertBackground (class Background)
Specifies the background color of the input line while in input mode.
status.foreground (class Foreground)
Specifies the foreground color of the status bar in normal state.
status.background (class Background)
Specifies the background color of the status bar in normal state.
status.errorForeground (class Foreground)
Specifies the foreground color of the status bar when displaying an error.
status.errorBackground (class Background)
Specifies the background color of the status bar when displaying an error.

COMMANDS

In addition to ed's standard command set, xed recognizes the following nonstandard commands. The commands are shown together with the default address or address range supplied if none is specified (in parenthesis).

(.)C
Interactively changes the addressed lines. In GUI mode, the lines are sequentially loaded into the input buffer, and the user is prompted to modify them interactively. In tty mode, the lines are printed in sequence, and the user is prompted to input a replacement for each line.
(1,$)|
Pipes the addressed lines through the given command, and replaces them in the buffer with the output of the command.
(.)I
Indents the addressed lines in a simple C-friendly, unobtrusive format. The indent level of a line is the number of leading tabs in the line; blocks, delimited by curly braces, are offset from their surroundings by one indentation level.

GUI BINDINGS

xed is equipped with an intuitive set of mouse and keyboard bindings for its graphical user interface. In addition to EM*CS-like bindings for the keyboard in the input area, xed recognizes the following mouse actions in the text area:

Button 1 Click
Sets the current address to the clicked line.
Button 1 Drag
Places a region of text in the X selection.
Button 2 Drag
Scrolls the text area.
Button 3 Click/Drag
Sets the selected address range in the input area to the range of lines dragged out by the mouse pointer.
Button 3 Shift-Click
Sets the target address for an m or t command to the clicked line.

SEE ALSO

ed(1), wish(1), regex(3).

KNOWN BUGS

The \`, \', \b, and \B escapes in standard ed regular expression syntax are not implemented, due to the non-existence of corresponding escapes in the Tcl regexp library.

Trailing tab characters in the input area of the X window are not displayed properly, although they can still be manipulated normally. There is no simple workaround for this, so it'll have to wait for a patch to the Tk core. A bug report has been submitted.