Screen Editor Cursor Control Keys
The set of control characters defined below can be used for correcting
mistakes while typing regular editing commands, for correcting commands
that have caused an error message to be displayed, for correcting lines
typed in append mode, or for inline editing using the v command
described in the commands section.
Se
provides key binding, that is,
the ability to for a user to reassign the meanings of the control keys.
Therefore, the list of control keys given below is merely the default
for the editor when no keys have been reassigned.
In fact, it is quite possible to arrange for a single key to
generate a commonly used word or phrase as well as to invoke special
built-in functions such as the date and time functions.
| CTRL_A | toggle_insert_mode | Toggle insert mode |
The status of the insertion indicator is inverted.
Insert mode, when enabled, causes characters typed to be
inserted at the current cursor position in the line
instead of overwriting the characters that were there previously.
When insert mode is in effect, INSERT appears
in the status line.
If the terminal is able to, the
shape of the cursor is changed when in insert mode.
| CTRL_B | g_scan_right | Scan right and erase |
The current line is scanned from the current
cursor position to the right margin until an occurrence of the
next character typed is found.
When the character is found,
all characters from the current cursor position up to (but not including)
the scanned character are deleted and the remainder of the line
is moved to the left to close the gap.
The cursor is left in the same column which is now occupied by the
scanned character.
If the line to the right of the cursor does not contain the character
being sought, the
terminal's bell is sounded
and the message NOCHAR appears in the status line.
Se
remembers the last character that was scanned using this
or any of the other scanning keys;
if control-b is hit twice in a row, this remembered character is
used instead of a literal control-b.
| CTRL_C | insert_blank | Insert blank |
The characters at and to the right of
the current cursor position are moved to the right one column
and a blank is inserted to fill the gap.
The effect of this key depends on
se's
current mode.
When in command mode, the current line pointer is moved
to the previous line without affecting the contents of the command line.
If the current line pointer is at line 1, the last line
in the file becomes the new current line.
In overlay mode (viz. the v command), the cursor is
moved up one line while remaining in the same column.
In append mode, this key is ignored.
The cursor is moved to the nearest tab stop to the left
of its current position.
The effect of this key depends on the editor's current mode.
In command mode, the current command line is entered as-is,
but is not erased upon completion of the command;
in append mode, the current line is duplicated;
in overlay mode (viz. the v command),
the current line is restored to its original state and command mode
is reentered (except if under control of a global prefix).
The cursor is moved one column to the right.
The cursor is moved one column to the left.
Note that this does not erase any characters;
it simply moves the cursor.
The cursor is moved to the next tab stop to the right of its current
position.
| CTRL_J | scan_right | Scan right |
This key is identical to the control-l key described below,
except that the scan proceeds to the right from
the current cursor position.
As with the control-d key,
this key's effect depends on the current editing mode.
In command mode, the current line pointer is moved to the next
line without changing the contents of the command line.
If the current line pointer is at the last line in the file,
line 1 becomes the new current line.
In overlay mode (viz. the v command),
the cursor is moved down one line while remaining in the same column.
In append mode, control-K has no effect.
The cursor is positioned according to the character
typed immediately after the control-l.
In effect, the current line is scanned, starting from the current
cursor position and moving left,
for the first occurrence of this character.
If none is found before the beginning of the line is reached,
the scan resumes with the last character in the line.
If the line does not contain the character being looked for, the
terminal's bell is sounded
and the message NOCHAR appears in the status line.
Se
remembers the last character that was scanned for using this key;
if the control-l is hit twice in a row, this remembered character
is searched for instead of a literal control-l.
Apart from this, however,
the character typed after control-l is taken literally, so
se's
case conversion feature does not apply.
| CTRL_M | enter | Kill right and terminate |
The characters at and to the right of the current cursor position
are deleted, and the line is terminated.
| CTRL_N | g_scan_left | Scan left and erase |
The current line is scanned from the current cursor position to the
left margin until an occurrence of the next character typed is found.
Then that character and all characters to its right up to
(but not including) the character under the cursor are erased.
The remainder of the line, as well as the cursor are moved to the
left to close the gap.
If the line to the left of the cursor does not contain
the character being sought, the
terminal's bell is sounded
and the message NOCHAR appears in the status line.
As with the control-b key, if control-n is hit twice in a row,
the last character scanned for is used instead of a literal control-n.
The cursor is moved to the first position beyond the current end of line.
| CTRL_P | identify | Identify Bindable Keys |
Press it and find out.
This key does the same thing as the page backwards command,
p, but works in overlay mode as well as command mode.
The window is moved backward in the file to display the
previous screenful.
| CTRL_R | del_right | Erase right |
The character at the current cursor position is erased and
all characters to its right are moved left one position.
This key does the same thing as the page forwards command,
:, but works in overlay mode as well as command mode.
The window is moved forward in the file to display the next screenful.
| CTRL_T | kill_right | Kill right |
The character at the current cursor position and all those to its right
are erased.
The character to the left of the current cursor position is deleted
and all characters to its right are moved to the left to fill the gap.
The cursor is also moved left one column,
leaving it over the same character.
| CTRL_V | t_skip_right | Skip right and terminate |
The cursor is moved to the current end of line and the
line is terminated.
The cursor is positioned at the left margin, i.e. column 1.
| CTRL_X | insert_tab | Insert tab |
The character under the cursor is moved right to the next tab stop;
the gap is filled with blanks.
The cursor is not moved.
All characters to the left of the cursor are erased; those at and
to the right of the cursor are moved to the left to fill the void.
The cursor is left in column 1.
| CTRL_Z | literal | Enter Literal |
This key provides a means for entering
se's
control characters literally as text into the file.
In fact,
any character that can be generated from the keyboard is
taken literally when it immediately follows this key.
If the character is non-printing (as are all of
se's
control characters),
it appears on the screen as the current non-printing
replacement character (normally a blank).
| CTRL__ | insert_newline | Insert newline |
When in append mode, a newline character is inserted before the
current cursor position, and the cursor is moved one position
to the right (the newline is displayed according to the current
non-printing replacement
character see the u option).
When in overlay mode, the current line is split, at the cursor position,
into two lines and the cursor remains in its place.
.tc
| CTRL_] | fix_screen | Fix screen |
The screen is reconstructed from
se's
internal representation of the screen.
| CTRL_\ | g_tab_left | Tab left and erase |
Characters are erased starting with the character at the nearest tab
stop to the left of the cursor up to but not including
the character under the cursor.
The rest of the line, including the cursor,
is moved to the left to close the gap.
| CTRL_^ | g_tab_right | Tab right and erase |
Characters are erased starting with the character under the cursor
up to but not including the character at the nearest tab stop to
the right of the cursor.
The rest of the line is then shifted to the left to close the gap.
The entire line is erased.
The escape key is not bound to any function by default.
The current line is moved to the top of the file, i.e. line 1.
This is equivalent to typing 1 on the command line and
pressing the Enter key.
| unbound | bottom | Bottom of file |
The current line is moved to the bottom of the file, i.e.
line $.
This is equivalent to typing $ on the command line and
pressing the Enter key.
| unbound | scroll_down | Scroll Down |
The effect of this key depends on
se's
current mode.
When in command mode, the current line pointer is moved
to the next line without affecting the contents of the command line.
In overlay mode (viz. the v command), the cursor is
moved up down line while remaining in the same column.
In either case, the text is scrolled up so that the cursor stays
on the same physical row on the screen.
In append mode, this key is ignored.
| unbound | scroll_up | Scroll Up |
The effect of this key depends on
se's
current mode.
When in command mode, the current line pointer is moved
to the previous line without affecting the contents of the command line.
In overlay mode (viz. the v command), the cursor is
moved up one line while remaining in the same column.
In either case, the text is scrolled down so that the cursor stays
on the same physical row on the screen.
In append mode, this key is ignored.
The current date appears at the cursor position as if the user had
typed it in.
The date is obtained from the system clock.
The current time appears at the cursor position as if the user had
typed it in.
The time is obtained from the system clock.
The name of the current month appears at the cursor position as if
the user had typed it in.
The date is obtained from the system clock.
| unbound | year2 | Enter Two-digit Year |
The current year appears at the cursor position as if the user had
typed it in.
The year will be abbreviated to a two-digit number, e.g. 1991 will
appear as 91.
The year is obtained from the system clock.
| unbound | year4 | Enter Four-digit Year |
The current year appears at the cursor position as if the user had
typed it in.
The year will be entered in full as a four-digit number, e.g. 1991 will
appear as 1991.
The year is obtained from the system clock.
| unbound | filename | Enter Current Filename |
The current file name, as displayed on the status line, appears
at the cursor position as if the user had typed it in.
If there is no saved file name, nothing appears.
| unbound | hostname | Enter Current Hostname |
The name of the host computer, as displayed by the l command,
appears at the cursor position as if the user had typed it in.
If there is no known host name, nothing appears.
| unbound | username | Enter Current Username |
The login ID of the user
appears at the cursor position as if the user had typed it in.
If it is not possible to determine the user name, nothing appears.
| unbound | curln | Enter current line number |
The number of the current line, i.e. the value of .,
appears at the cursor position as if the user had typed it in.
| unbound | topln | Enter top-of-screen line number |
The number of the line at the top of the screen,
i.e. the value of #,
appears at the cursor position as if the user had typed it in.
| unbound | lastln | Enter end-of-file line number |
The number of the last line in the file,
i.e. the value of $,
appears at the cursor position as if the user had typed it in.
| unbound | upper | Convert to Uppercase |
If the cursor is positioned over a lower-case character,
it is converted to upper case.
Non-lower case characters are unaffected.
The cursor is not moved.
| unbound | lower | Convert to Lowercase |
If the cursor is positioned over an upper-case character,
it is converted to lower case.
Non-upper case characters are unaffected.
The cursor is not moved.
| unbound | ascii | Display ASCII code |
The ASCII code for the current character is displayed in hexadecimal
on the status line.
If the cursor is positioned at the end of a line, the word
NEWLINE is displayed; this is because some operating systems
use a multi-character sequence to represent line breaks and
se
regards this as a single, special character internally.
The cursor is not moved by this function.
See also the ou option if you need to see unprintable
characters on
se's
display.
| unbound | first_char | First Character in Line |
The cursor is positioned on the first non-blank character of the line.
If there are no non-blank characters on the line, the effect is the
same as home, i.e. the cursor moves to the left margin.
This function is useful as an alternative to home when
se
is in auto-indent mode.
| unbound | last_char | Last Character in Line |
The cursor is positioned on the last non-blank character of the line.
If there are no non-blank characters on the line, the effect is the
same as end, i.e. the cursor moves to the right-hand end
of the line.
This function has no effect.
It is useful whenever a key needs to be completely disabled.
Note that it is not a good idea to disable the return key...
Since
se
takes its commands directly from the
terminal,
it cannot be run from a script by using
Shell
I/O redirection, and
Unix
erase, kill, and escape conventions do not exactly apply.
(If you want to run
se
from a script, see the documentation for the oo option.)