Manpage of asdfg
Section: User Commands (1)
Updated: June 27, 2007
Return to Main Contents
asdfg - a lightweight visual editor optimized for the QWERTY keyboard
is an interactive display text editor optimized for users of the
QWERTY keyboard layout.
When run with no file name arguments,
displays a short command introduction and summary.
can browse very large read-only files with quick start-up,
since original texts are memory-mapped from files and not
duplicated in memory until they are about to be modified.
INTENTIONALLY MISSING FEATURES
has no embedded extension language, since it is trivial to
pass regions of text from the editor to any program or script
that can read standard input and write standard output.
are all usable for such scripting.
ships will full sources and the rights to modify it,
users can customize it directly.
The editor has no syntax highlighting modes, apart from
subtle color cues that help match up parentheses, brackets,
has no mail or news reader, IRC client, or artificial intelligence
There is no X window system interface; that's what
is a sequence of characters to be viewed or edited, such as a file.
If not ASCII, the editor will automatically determine whether it is
encoded in legal UTF-8 and do the right thing.
The editor can also automatically detect DOS-style line endings.
comprises all or part of a text.
A text in the editor has at least one view, and possibly more.
is a rectangular portion of the display, and is always associated
with a single view, a contiguous portion of whose text is rendered
in the window. Not every view has a window.
Each view has a
and possibly a
which has the cursor at one end and the
at the other.
The view's window, if any, always renders part of the text containing
the view's cursor.
is not visible in any window.
It receives snippets of data that have been cut or copied out of
texts, so that they may be moved or copied elsewhere.
It also supplies the standard input to a background command
There is one clip buffer shared by all views.
asdfg uses colors to convey information without cluttering the
display with status lines or borders between windows.
asdfg uses distinct background colors to distinguish tiled windows.
The active window is always presented in the terminal's default
Color is also used to highlight the current selection (in cyan)
and folded regions (in red).
Needless tabs and spaces are marked in violet. These include
any tabs or spaces before the end of a line, as well as any
spaces followed by a tab or multiple spaces that could be
replaced by a tab.
Bracketing characters are presented in alternating colors so that
matching parentheses, brackets, and braces are colored identically.
A red cursor signifies a read-only text, whereas a green cursor
indicates a dirty text (meaning one that needs saving, not one
unfit for young persons).
Commands are denoted here by
to signify the use of Control, Alt, or a leading Escape key.
They all mean the same thing.
commands always begin with
or its synonym,
A few commands take a numeric argument, which is specified by
followed by a decimal or hexadecimal number, the latter
using C language syntax (0xdeadbeef).
Many commands are sensitive to the presence or absence of a
aborts the editor, leaving no original file modified since the
suspends the editor and returns the terminal to the shell that
Use the shell's foreground command, probably
to resume editing.
saves all modified texts and terminates the editor.
The "backward and forward by unit" commands treat a numeric argument,
if any, as a repeat count.
moves the cursor backward by characters.
moves the cursor forward by characters.
moves the cursor backward by words.
moves the cursor forward by words.
moves the cursor backward one sentence.
moves the cursor forward one sentence.
moves the cursor back to the beginning of the line.
If already there, it moves back to the beginning of the previous line.
moves the cursor forward to the end of the line.
If already there, it moves forward to the end of the next line.
moves the window backward by screenfulls.
moves the window forward by screenfulls.
moves to the very beginning of the view.
moves to the very end of the view.
moves to the corresponding parenthesis, bracket, or brace, respecting
nesting, if the cursor sits atop such a character.
Otherwise, it moves to the nearest enclosing bracketing character.
recenters the window so that the line containing the cursor lies in
the middle of its portion of the display.
causes the current window to occupy the entire display and recenters
With a numeric argument, however, it simply
moves the cursor to the indicated line in the view, with 1 being the
number of the first line.
is not a control character)
sets a bookmark on the current selection or cursor position.
A numeric argument may be used to manage multiple bookmarks.
is not a control character)
returns to a previous set bookmark, possibly identified with a
(note that the single quote
is not a control character)
looks an identifier up the identifier in the
file, which is automatically loaded into the editor if it is
not already present, and if the identifier is found therein,
the corresponding file name and line number are sought.
file should be generated with the
utility and its
If there is a selection, it is deleted from the view and its entire contents
will constitute the identifier to be looked up; otherwise, the identifier
that is immediately before or around the cursor is sought.
These commands are sensitive to the presence or absence of a current selection.
begins a new selection if non exists, setting its mark at the current cursor,
which is then typically navigated to its intended other end.
in the presence of selection simply removes the mark.
without a selection causes the entire current line to be
selected by placing the mark at the end of the line and the cursor at
its beginning. It is the same as the command sequence
with no selection.
With a selection present,
exchanges its cursor with its mark.
with a numeric argument unconditionally unsets the mark, which can be
handy in a macro.
with no selection causes all of the contiguous white space characters
surrounding the cursor to be selected, with the cursor at the beginning so
that they can be easily replaced by retyping.
has infinite undo capabilities.
reverses the effects of the last command, apart from
itself, that modified the current text in any of its views.
reverses the effects of the most recent undo.
command that modifies the text will permanently commit the undo(s).
In the default mode, characters typed without a command indicator
are inserted at the current cursor position.
Further, if the cursor is at the beginning of a selection, the selection is
first cut to the clip buffer, so that the new text replaces it.
(that's Control-Shift-6, the caret character, on most keyboards,
and ^6 will probably also work)
inserts an untypeable control character into the text.
The very next key to be pressed is either taken literally,
if it is a control character, or converted to a control character
if it is not, and inserted.
(For example, you can press
and then hit either Control-A or just a plain A, to get the
character code 0x01 inserted.)
with a numeric argument, probably in hexadecimal, inserts the
specified Unicode character into the text in UTF-8 format.
attempts to perform tab completion; if that fails, a TAB character
If there is a selection with the cursor at its end, the editor
tries to find an unambiguous continuation based on path names
and words in all the views.
A continuation, if found, is appended to the selection, to
facilitate opening a file with
With no selection, but the cursor immediately after one or more
identifier characters, the editor searches for an unambiguous
continuation using the words in the views.
A continuation, if found, is inserted as the new selection
with the cursor at its end.
No tab completion occurs when the cursor is at the beginning
of a selection; in that case, the selection is cut and replaced
with a single TAB character.
will align the current line to the indentation of the previous one.
With a numeric argument between 1 and 20, it will set the tab stop pitch.
under some terminal emulators)
inserts a new line into the text with automatic indentation.
opens up a new line after the current one.
(or more properly, its synonym
deletes the character immediately before the cursor.
with no selection deletes the character "under" the cursor.
When a selection exists,
moves it into the clip buffer, discarding any previously clipped text.
with no selection will select surrounding white space, as described
When a selection exists,
moves it into the clip buffer, putting it before any old text if the cursor
was at its beginning and appending it to the clip buffer if the cursor
was at its end.
The intent is for multiple
commands to collect data together in the same order in which
they are most likely to have been visited.
requires a selection, which is copied into the clip buffer and
It copies the selection to the clip buffer, putting it at the beginning or the end in the same way as
with no selection will paste the current clip buffer's contents.
But in the presence of a selection it performs a more general function:
the contents of the selection and the clip buffer are exchanged.
With a numeric argument,
pastes or exchanges with a numbered
which is an alternate clip buffer.
(The main clip buffer is the same as register 0.)
Besides being a means for preserving some text for longer periods
of editing, the registers also serve as a means for extracting
the text that matches a parenthesized subpattern in a regular expression
and its synonym
enter search mode.
The variant command
searches for occurrences of POSIX regular expressions.
Each non-command character that is typed thereafter will be appended
to the current search target string and the selection is moved to the
next occurrence thereof.
The case of alphabetic characters is
significant to the search.
Most command characters will automatically take the editor out of
search mode before executing, and the most recently discovered
occurrence of the search target string will be its selection.
A few commands have different meanings in search mode:
will remove the last character from the search target and
move the selection back to its previous position.
is typically used to leave search mode with the cursor at the beginning of
the latest hit, with the mark returned to where it was before the search
with no characters in the search target string will cause the
last search's target string to be reused.
cause motion to the previous and next occurrences of the search
target string, not single-character motion.
simply leaves search mode with the last hit as the selection.
TEXTS, VIEWS, and WINDOWS
modified texts back to their files.
saves just the current text.
with no selection inserts, as the new selection, the path name of the
current text. With a selection containing a path name,
possibly constructed with the assistance of tab completion (above),
will raise up a window containing a view into the indicated file,
creating a new text to hold it if one does not already exist.
with a selection will rename the current text, so that it will be
saved in another file.
finds an invisible view and associates it with the current window,
making its current view invisible. Hitting
repeatedly will cycle through all of the views.
If there was no invisible view,
creates a new scratch text, as does
does the same thing. but will close the window's current view,
and also its text if it was the last view thereof.
splits the current window horizontally, raising up an invisible
or new view in the lower half of the original window.
splits the current window vertically, raising up an invisible or new
view in the right half of the original window.
moves to another window.
moves to another window, closing the old one.
is not a control character)
creates a new anonymous text.
commences the recording of your keystrokes as the current view's local
macro, which continues until the next
or another macro recording.
commences the recording of your keystrokes as a new global macro for a
are typically hijacked by window managers for their own purposes and
probably will not be usable.
ends the recording of a macro, if one is in progress.
replays the view's local macro.
supports the "folding" of portions of text into what appear to be
single characters, and the reverse "unfolding" operation.
Further, to provide outline views of texts such as source code
that are heavily indented,
has an automatic nested folding capability.
with a selection will fold the selection.
Otherwise, it will repeatedly fold
indented regions of the text to provide an outline view.
A numeric value, if any, specifies the number of leading spaces or
equivalent tabs at which code lines will be folded.
The default is 1, causing the folding of any line that isn't left-justified.
with a selection will unfold the topmost foldings within it.
Otherwise, if there is no numeric value, it will unfold the
single folded region immediately beneath the cursor.
With a numeric value, which is ignored, it will completely
unfold the entire view.
with no selection will launch an interactive shell in a new scratch
With a selection, however,
will execute the shell command in the selection with the contents
of the clip buffer, if any, as its standard input, and collect its
output asynchronously in the background to replace the selection.
This allows many helpful UNIX text processing commands to be
Some handy commands to know:
to include another entire file, or to receive writes to a named pipe
to create a named pipe so that commands in other windows may direct
their output into a text running
in the background.
- cd path
to change the editor's current working directory (a special case command
that is not actually passed to a shell)
to search for lines containing a pattern
to rearrange lines alphabetically or numerically, possibly reversed
to discard duplicated lines
to perform unconditional search-and-replace with regular expressions
to convert lower to upper case with
and to remove DOS carriage returns with
to reformat paragraphs of natural language text
- indent -st -kr -i8 -nbbo
to reformat C language source code sensibly
- column -t
to realign data nicely into columns
- man | colcrt
to read a man page
to monitor additions to a file such as a log
to compile your code
- aspell -l | sort | uniq | column
to get a list of words that may be misspelled
with no selection will terminate the output of any asynchronous
child process that's still running.
To select the rest of the line after the cursor, use
It is often faster to retype a bungled word than to fix it, using
and then retyping.
Transposing multiple blocks of text is easy with
which generalized the usual paste operation into an exchange of the clip buffer
with the selection.
Incremental search and replacement can be done with a macro or by
clipping the replacement text, and on search hits that are to be
to exchange the hit with the replacement text, copy it back to the
clip buffer, and proceed to the next occurrence of the search pattern.
But when the replacement text is short, it's sometimes easiest to just
overwrite the selection by hitting
to leave search mode and immediately retyping it, since the cursor
will be placed at its beginning.
Reconfigure your keyboards so that the key to the left of A, which is
is interpreted as a Control modifier instead.
terminal emulator works well with
if you configure the terminal's scrollback limit to a relatively
To move backward or forward by half a screenfull, use
Inevitable; please tell me about any that you find.
is used to name the program run by the
may be set to override
automatic mechanisms for determining the size of the display surface.
when set to
to try to set the title of the window to the name of the active view.
is overwritten with the original contents of
contains the temporary image of the edited file
is running, and may be useful in recovery if the editor
is read in by the
command, if not already present, to supply the tags that are
scanned. It should contain the output of
holds any new "anonymous" texts created during editing sessions.
Helpful commands to use with
Peter Klausler <email@example.com> wrote
- INTENTIONALLY MISSING FEATURES
- COLOR CUES
- TEXTS, VIEWS, and WINDOWS
- SEE ALSO
This document was created by
using the manual pages.
Time: 13:59:16 GMT, July 12, 2007