- : area command arguments
- Perform the command
command on the area
area .
-
-
- : command arguments
- Perform the command
command at the current position.
- : area
- Select the area
area .
- : position
- Move the cursor to position
position . An area may be defined as:
- position1,position2
- The area starts at
position1 and ends at
position2 (inclusive).
- position
- The area selects one byte at
position
- %
- The area selects the entire buffer.
A position may be defined as:
- offset
- A decimal, octal (prefixed with `0') or hex (prefixed with `0x') number.
- .
- The beginning of the buffer.
- $
- The end of the buffer.
- / regexp /
- A regular expression
(see section
"REGULAR EXPRESSIONS" ). The buffer is searched forward starting at the current
position. If a match was found, the current position is set to the position
of the match.
- ? regexp ?
- The buffer is searched reverse.
Commands may be abbreviated with a unique prefix of the command, some commands
may be abbreviated with a single character, even if that character isn't a
unique prefix of the command name.
Currently the following commands are supported:
- s, substitute
- Synopsis: area s / regexp / replace / flags
Search for the regular expression
regexp and replace it with
replace (see section
"REGULAR EXPRESSIONS" ). replace may contain `\' references to subexpressions of
regexp . flags :
- g :
- global, this flag is ignored (it doesn't make sense in a binary editor).
- c :
- confirm, ask the user to confirm each substitution.
(Note that the `/' character used as separator could be any character,
it's just common practice to use `/'.) Trailing separators may be omitted.
If
area is omitted, the whole buffer is searched.
- w, write
- Synopsis: area w filename
Write
area to the file
filename . If
area is omitted. the whole buffer is written to the file, if
filename is omitted, the filename associated with the buffer is used.
- r, read
- Synopsis: position r filename
Insert the contents of the file
filename at
position . If
position is omitted, the current position is used.
- e, edit
- Synopsis: e name or: e #
Change to buffer
name . If there is no such buffer,
hexer tries to open a file named
name and load it into a new buffer. If
name is a hash sign
the alternate buffer is selected. On success the current
buffer becomes the alternate buffer.
- b, buffer
- Synopsis: b name
or: b
Change to buffer
name . On success the current buffer becomes the alternate buffer. If
name is omitted, a list of all buffers is displayed.
- n, next
- Select the next buffer in the buffer list.
- N, previous
- Select the previous buffer in th buffer list.
- S, skip
- Select the next unvisited buffer in the buffer list.
- rewind
- Select the first buffer in the buffer list.
- wall
- Write all unsaved buffers.
- c, close
- Synopsis: c name
or: c! name
or: c
or: c!
Close the buffer
name . If
name is omitted, the current buffer is closed. If the buffer has been modified,
but not saved, it can't be closed using a
:c -command; use
:c! to override.
- h, help
- View an online help text.
- q, quit
- Synopsis: q name
or: q! name
or: q
or: q!
Close all buffers and exit the editor. If an opened buffer has bee modified,
but not saved, the
:q -command can't be performed; use
:q! to override.
- map
-
- imap
-
- vmap
- Synopsis: map from to
or: imap from to
or: vmap from to
The key sequence
from is mapped to
to . To enter special keys (e.g. function keys), mask them using
"Control-V" . :map affects the
Command Mode only,
:imap affects the
Insert Mode only and
:vmap affects the
Visual Mode only. It is not possible to re-map key sequences on the command line editor.
- unmap
-
- iunmap
-
- vunmap
- Synopsis: unmap from
or: iunmap from
or: vunmap from
Delete a key mapping created with
:map , " :imap" or
:vmap .
- set
- Synopsis: set variable [...]
or: set variable = value [...]
or: set no variable [...]
or: set
There are not too many variables that could be modified, this might change
though. The following variables can be used:
iso (bool): display the whole ISO-8859/1 character set;
ascii (bool): display ASCII characters only;
TERM (string): the name of the terminal;
maxmatch (number),
specialnl (bool): see section
"REGULAR EXPRESSIONS" . :set called without an argument lists all variables and values.
- d, delete
- Synopsis: area d
Delete all bytes in
area . The deleted bytes are copied to the kill buffer.
- y, yank
- Synopsis: area y
Copy the bytes in
area to the kill buffer.
- version
- Display the version number of
hexer .
- zz
- Place the cursor in the middle line of the screen. Note that the
screen is scrolled (if necessary); the cursor position is kept unchanged.
- zt
- Place the cursor in the top line of the screen.
- zb
- Place the cursor in the bottom line of the screen.
- wq
- The same as
:x .
- x, exit
- Save all buffers and exit the editor.
If a command is called and can't use the given positions, areas or arguments,
the additional positions, areas, arguments are ignored.
Conditional commands: It is possible to specify a list of terminal names for which the given
command should be executed. The syntax is:
: terminals : command
where
terminals is a colon-separated list of terminal names. The command is executed if and
only if the value of
TERM is in the list. I.e. you could have a command like
:xterm:set iso
in your
.hexerrc -file (use the ISO character set only if working on an xterm).