xe(8)

NAME
xe - a text editor for X

SYNOPSIS

xe [-display display name] [-geometry geometry spec] [-v] [-nofork] [-orphan] [filename]

DESCRIPTION

xe is a lightweight, fast and simple text editor for X. The user interface consists of a fairly standard layout, with a menu bar along the top of the window, a scroll bar on the left side and the rest filled with the text area.

Some simple searching and editing functions are available. xe is able to open multiple files, however the file selection user interface is quite crude at the moment.

The command keys of the menu commands as well as the key mapping of most text field operations are configurable via X resources. xe has a configuration file of its own: ~/.xerc which is read at startup, see the section STARTUP.

Note: whenever this man page refers to the Alt key it refers to the X Mod1 modifier.

OPTIONS

-display display name
    Run on a specific display other than what is specified in the DISPLAY environment variable.

-geometry geometry spec
    Provide a custom position and size for xe when it starts up. The format of the geometry string is the standard X geometry spec, with the width and height parameters providing the number of rows and columns of the text field.

-v  Prints out version number and exits.

-nofork
    By default xe forks itself into the background. The -nofork option prevents this behavoir.

-orphan
    If runOnce is enabled (in the .xerc file) this option disables it, making xe create a new process each time it is run.

STARTUP

Upon startup xe reads in filename as specified on the command line. If no file was given, then xe opens an empty window with the name "Untitled". If there is some kind of error reading from filename, a blank window is opened anyway and an error message appears in the centre of the screen.

Configurable options are read in as follows:

X Resources
    First the standard X resource files and command line options are read. see the section X RESOURCES for a complete description of the X resources recognised by xe.

~/.xerc
    Then, various global options are read in from the .xerc file in the home directory of the user ID that xe was launched under. These options apply to specific parts of xe and all of these options may eventually end up as X resources. See the section XERC for a complete description of these options.

MOUSE

The mouse functions as expected for a mouse-based editor. The following operations are defined in the text area.

Left Button
    positions the caret in the text area, clearing any selection. Clicking and dragging extends the selection from the initial position, combined with the Shift Key this extends an already existing selection.

Middle Button
    operates the same way as the Left Button, except that whole words are selected instead of single characters. Combining with the Alt Key, the caret is positioned and when the button is released, the current X Selection is inserted at that position.

Right Button
    pans the text around in 2 dimensions, following the mouse pointer and auto-scrolls off the top or bottom of the text.

The scroll bar works as expected. The Middle Button moves the scroll handle to the centre of the position clicked.

In text fields, the Middle Button pastes from the X Selection without needing the Alt modifier.

KEYBOARD

The keyboard works in the standard way. Normal characters are inserted, defined text area operations such as caret movement, and selection etc can be invoked, as well as command keys defined by the menus.

The various text operations and menu commands, with their default keys are described below.

X RESOURCES

The X resources documented here are the only ones supported by xe at the moment. Future versions will recognise more of them.

A form of X resource that xe uses is Key Spec which is used to specifiy a key with a combination of modifiers. The format of this is: [ modifier modifier... ] <key> where modifier can be one of Shift, Alt or Ctrl and <key> is an X keysym name, without the leading XK_. The list of X keysyms can be found in the file /usr/include/X11/keysymdef.h.

geometry
    Specifies the position and size (in lines and columns) of all top level windows. Same as the -geometry flag.

Menus

The only resource recognised by menu items is key, which takes a value of the form Key Spec:<string> where Key Spec is the command key used and <string> is the label that represents the key in the menu. The menus, with the resource name for each menu item, the default value of the key resource and a description of each menu item are shown below.

File Menu - *mainWindow.menuBar.file

new (Alt n:n)
    Creates a new "Untitled" editor window.

open (Alt o:o)
    Prompts for a filename (with a crude-looking file chooser) and opens it in a new editor window.

close (Alt w:w)
    Closes the current editor window. Note, this command doesn't prompt when the file is unsaved.

reopen (Alt Shift r:r)
    Re-reads the file from the disk, discarding any changes.

save (Alt s:s)
    Saves the text. Prompts for a filename if the window is "Untitled". The file is written to disk even if the text hasn't been modified since last save.

quit (Alt q:q)
    Quits the program. The user is only prompted if when there are unsaved editor windows open.

Edit Menu - *mainWindow.menuBar.edit

undo (Alt z:z)
    Un-does the previous operation. An operation consists of the change of selection (including caret position) or the insertion or removal of text by any means.

redo (Alt r:r)
    Re-does the the operation that was last undone. All redo events are cleared when a new operation is performed.

cut (Alt x:x)
    Copies the selected text into the xe clipboard and then deletes the text.

copy (Alt c:c)
    Copies the selected text into the xe clipboard. Note, this clipboard is not the X clipboard but a separate buffer that is shared among all xe processes.

paste (Alt v:v)
    Inserts the text in the xe clipboard in place of the current selection.

clear
    Deletes selected text.

selectAll (Alt a:a)
    Selects all of the text.

xpaste (Alt p:p)
    Same as paste but gets the data from the X clipboard (the X client that holds the X selection).

tabToggle (Alt t:t)
    Toggles the tab width between the two set up in the .xerc file.

Search Menu - *mainWindow.menuBar.search

find (Alt h:h)
    Brings up the Find dialog box. The search string, search direction, case sensitivity and type of search can be entered here. Pressing the Ok button will execute the search.

findAgain (Alt g:g)
    Repeats the previous search, using all the previously set parameters.

findForward (Alt f:f)
    If some text is selected and the selection is only on a single line, the search string is replaced with this text and the next occurence is searched for. Otherwise, findAgain is performed with the search direction set to forward.

findBackwards (Alt b:b)
    The same as findForward except the search direction is always set to backwards.

jumpTo (Alt j:j)
    Brings up the Jump dialog box. A line number can be entered here. Choosing Ok will cause the cursor to jump to the beginning of the given line.

braceMatch (Alt m:m)
    Selects the text encompassed by the closest set of closed braces around the current cursor position.

Window Menu

This menu contains a list of all editor windows currently opened by the current running process of xe. The name displayed is the same as the window's icon name. X resources can't be set on individual menu items in this menu at the moment.

Text - *mainWindow.text

The various resources with their default resource and description are shown below. All these resources take a Key Spec as their value. X resources are not supported by text fields at the moment.

up (Up)
    Move the caret up one line.

down (Down)
    Move the caret down one line.

left (Left)
    Move the caret left by one character.

right (Right)
    Move the caret right by one character.

extend_up (Shift Up)
    Extend the selection up one line.

extend_down (Shift Down)
    Extend the selection down one line.

extend_left (Shift Left)
    Extend the selection left by one character.

extend_right (Shift Right)
    Extend the selection right by one character.

prev_word (Alt Left)
    Move the caret left by one word.

next_word (Alt Right)
    Move the caret right by one word.

extend_prev_word (Alt Shift Left)
    Extend the selection left by one word.

extend_next_word (Alt Shift Right)
    Extend the selection right by oe word.

start_line (Ctrl Left)
    Move the caret to the beginning of the line.

end_line (Ctrl Right)
    Move the caret to the end of the line.

extend_start_line (Ctrl Shift Left)
    Extend the selection to the beginning of the line.

extend_end_line (Ctrl Shift Right)
    Extend the selection to the end of the line.

page_up (Page_Up)
    Move caret up a page.

page_down (Page_Down)
    Move caret down a page.

home (Home)
    Move caret to the beginning of the file.

end (End)
    Move caret to the end of the file.

The following colours can be set using X colour names. These resources also apply to *mainWindow.textField.

background (grey85)

foreground (black)

lineNumColour (blue)

activeColour (red)

inactiveColour (grey50)

XERC

The .xerc file contains token-value pairs on each line. A # symbol causes the rest of the line to be ignored. The token-value is separated by any whitespace. Here is a list of all recognised tokens with their default value in parentheses:

windowName (%m*%%F%r [view-only]%)
    Format string for the title of the top level windows. This string can contain any character along with special option strings which are substituted with various things:

    %m<string>% <string> is shown when the text is modified.

    %r<string>% <string> is shown when the text is read-only.

    %F full path name of file being edited.

    %f filename without path component of file being edited.

iconName (%r[ %%m*%%f%r ]%)
    Format string for the icon name of all top level windows. Same format as windowName.

lines (30)
    The initial height in lines of the text area.

columns (80)
    The initial width in characters of the text area.

font (-b&h-lucidatypewriter-medium-r-normal-sans-12*)
    The font that is displayed in all text widgets.

breakChars (=(),*.;{}[]<>"-+/&|~^?!:)
    The characters that are used as boundaries for word selection. Whitespace and newlines are implicit boundaries.

lineNumbers (true)
    Display of line numbers. Can be true or false.

autoIndent (true)
    Auto indent causes initial whitespace from the current line to be copied onto the next when the enter key is pressed.

tab (8)
    Sets the tab width of the text area.

tabToggle (4)
    Sets an alternate tab width, switched to using the Tab Toggle menu command.

softTab (4)
    Sets the tab width the tab key uses. If its width is less than the current tab width then the columns are filled up with spaces. Spaces are collapsed into tabs when the tab is wide enough to fill the necessary space.

maxUndos (100)
    This is the maximum number of keystrokes and selection events that are saved by each text area.

scrollTimeout (0.03)
    Time interval in seconds between successive scroll steps when auto scrolling.

scrollAccel (1.0)
    Controls auto-scroll acceleration. A lower number increases acceleration.

scrollAmt (2)
    Configures the number of lines scrolled when using the up and down keys to scroll beyond the bounds of the visible text.

rightScroll (false)
    Causes the scrollbar to appear on the right hand side of the window if set to true.

runOnce (false)
    When false, running xe creates a new process each time. When true, a new window is opened in a currently running process with the same client IP number and userid as the original process.

usePlanemask (true)
    When true, xe uses the X planemask to draw selection hilights. If selection highlights are slow, then hardware planemasks are not supported on your graphics card by X. You can improve performance of selection hilights by setting this value to false, such that the planemask isn't used.

FILES

xe reads in the standard X resource files as well as its own configuration file: ~/.xerc.

SEE ALSO

X(1)

DIAGNOSTICS

xe reports file-open errors in dialog boxes. Some other more obscure errors may happen and these are printed to stderr.

BUGS

There are quite a few bugs in xe, most of which are not serious, that is they are mostly redraw/display related and don't affect the content of the text being edited. For a semi-complete list of bugs see the BUGS file that comes with the xe distribution.

AUTHOR

Ben Ross (ben@proximity.com.au)

Brian Murray - provided some excellent C++ classes.