Editor Command Summary

RangeSyntaxFunction

.a[:text]Append
Inserts text after the specified line. Text is inserted until a line containing only a full stop and a newline is encountered. If the command is followed immediately by a colon, then whatever text follows the colon is inserted without entering “append” mode. The current line pointer is left at the last line inserted.

.,.c[:text]Change
Deletes the lines specified and inserts text to replace them. Text is inserted until a line containing only a full stop and a newline is encountered. If the command is followed immediately by a colon, then whatever text follows the colon is inserted without entering “append” mode. The current line pointer is left at the last line inserted.

.,.dDelete
Deletes all lines between the specified lines, inclusive. The current line pointer is, by default, left at the line after the last one deleted. See the ‘od’ option for a full description. See also the ‘u’ command for information on how to undo a deletion.

nonee[x][!] [!][file]Enter
Loads the specified file into the buffer and prepares for editing. Automatically invoked if a filename is specified as an argument on the command line used to invoke the editor. The current line pointer is positioned at the first line in the buffer.

An error message is generated if the editing buffer contains text that has not been saved. The enter command may be resubmitted after the error message, in which case it will be obeyed. The “enter now” command ‘e!’ may be used to avoid the error message.

If the file being read in contains <TAB> characters, se will normally treat them as “unprintable”, and they will not appear as expected. In order to expand <TAB> characters into the correct number of spaces, use the ‘ex’ command. Alternatively, see the discussion of the ‘ox’ option.

If the filename begins with a ‘!’, it is assumed to be a Shell command. The command's Standard Output is read into the buffer.

nonef [file]File
Print or change the remembered file name. If a name is given, the remembered file name is set to that value; otherwise, the remembered file name is redisplayed.

1,$g/pat/commandGlobal on pattern
Performs the given command on all lines in the specified range that match the given pattern.

noneh[stuff]Help
Provides access to online documentation on the Screen Editor. “Stuff” represents the name of the topic on which help is required. Typing ‘h’ alone will display the initial help directory; from there it is possible to locate the topic of interest.

.i[:text]Insert
Inserts text before the specified line. Text is inserted until a line containing only a full stop and a newline is encountered. If the command is immediately followed by a colon, then whatever text follows is inserted without entering “append” mode. The current line pointer is left at the last line inserted.

^,.j[/stuff[/]]Join
The specified lines are joined into a single line. You may specify in “stuff” what is to replace the newlines that previously separated the lines. The default is a single blank. Thus ‘j’ is equivalent to ‘j/ /’. In general, se will supply trailing delimiters for you. So ‘j/’ is the same as ‘j//’, i.e. replace the newline(s) with nothing (delete them).

.,.kmmarK
The specified lines are marked with 'm' which may be any single character other than a newline. If 'm' is not present, the lines are marked with the default name of blank. The current line pointer is never changed.

nonelLocate
The name of the current machine is displayed on the status line. This is so that one can tell what machine he is using from within the editor. This is particularly useful for installations with many machines that can run the editor, where the user can switch back and forth between them, and become confused as to where he is at a given moment. In fact, it is even more useful when a windowing system such as X-Windows is being used, because several se screens are usually visible, all running on different hosts.

.,.m<line>Move
Moves the specified block of lines after <line>. <Line> may not be omitted. The current line pointer is left at the last line moved.

.,.n[m]Name
If ‘m’ is present, the last line in the specified range is marked with it and all other lines having that mark name are given the default mark name of blank. If ‘m’ is not present, the names of all lines in the range are cleared.

noneo[stuff]Option
Editing options may be queried or set. “Stuff” determines which options are affected. See the se options reference section.

.,.pPrint
As much as possible of the range is displayed, always including the last line; if no range is given, the previous page is displayed. The current line pointer is left at the last line in the range.

noneq[!]Quit
Exit from the editor. An error message is generated if the editing buffer contains text that has not been saved. The quit command may be resubmitted after the error message, in which case it will be obeyed. The “quit now” command ‘q!’ may be used to avoid the error message.

.r[x] [!][file]Read
Insert the contents of the given file after the specified line. The current line pointer is left at the last line read. See the discussion of the ‘e’ command and the ‘ox’ option for information on <TAB> characters.

If the filename begins with a ‘!’, it is assumed to be a Shell command. The command's Standard Output is read into the buffer.

.,.s[/pat/sub[/][g]]Substitute
Substitutes ‘sub’ for each occurrence of the pattern ‘pat’. If the optional ‘g’ is specified, all occurrences in each line are changed; otherwise, only the first occurrence is changed. The current line pointer is left at the last line in the range in which a substitution was made. The trailing slash may be omitted with no ill effect. Thus ‘s/junk/stuff’ is entirely equivalent to ‘s/junk/stuff/’. If you type an ‘s’ by itself, without a pattern and replacement string, se will behave as though you had typed ‘s//%/’, i.e. substitute the previous replacement pattern for the previous search pattern.

.,.y[/from/to[/]]translYterate
The range of characters specified by ‘from’ is transliterated into the range of characters specified by ‘to’. The last line in the range becomes the new current line. Again, if you leave off the trailing delimiter, se will put it in for you. In addition, like the ‘s’ command, both the ‘from’ and ‘to’ parts are saved; ‘y//%/’ will perform the same transliteration as the last one, and ‘y’ is the same as ‘y//%/’. The ‘%’ is special if it is the only character in the ‘to’ part, otherwise it is treated as a literal ‘%’.

.u[d]Undo
The specified range of lines is replaced by the last range of lines deleted. If the ‘d’ is used, the restored text is inserted after the last line in the specified range. The current line pointer is set at the last line that was restored.

.,.voVerlay
“Overlay mode” is entered and the control characters may be used to modify text anywhere in the buffer. A control-V may be used to quit overlay mode. A control-F may be used to restore the current line to its original state and terminate the command. See the se control character reference for a full description of cursor-key editing in “overlay mode”.

1,$w[!][>|+][q] [!][file]Write
Writes the portion of the buffer specified to the named file. The current line pointer is not changed. If ‘+’ or ‘>’ are given, the portion of the buffer is appended to the file; otherwise the portion of the buffer replaces the file.

If ‘!’ is present, an existing file specified in the command is overwritten without comment. If ‘filename’ is not present, the specified lines will be written to the current file name as shown on the status line.

If the ‘q’ is present, se quits immediately after writing the file (unless the write failed). This is a convenient shorthand.

If the filename begins with a ‘!’, it is assumed to be a Shell command. The contents of the buffer are piped into the command's Standard Input.

1,$x/pat/commandeXclude on pattern
Performs the command on all lines in the given range that do not match the specified pattern. Contrast with the ‘g’ command.

.,.t<line>To
Makes a copy of all the lines in the given range, and inserts the copies after <line>. As with the ‘m’ command, <line> may not be omitted. The current line pointer is set to the new copy of the last line in the range.

.,.zb<left>[,<right>][<char>]draw Box
A box is drawn using the given <char> (blank by default, allowing erasure of a previously-drawn box). Line numbers are used to specify top and bottom row positions of the box. <Left> and <right> specify left and right column positions of the box. If second line number is omitted, the box degenerates to a horizontal line. If right-hand column is omitted, the box degenerates to a vertical line.

nonezvVersion
The version number of se is displayed on the status line, together with the type of video driver, the operating system, the pattern-matching characters (SWT or VI) and the type of buffer organisation. This information is often useful when reporting problems with se.

.=Equals
The number of the specified line is displayed on the status line. The current line pointer is not changed.

1,$~mcommandExclude on markname
Similar to the ‘x’ prefix except that ‘command’ is performed for all lines in the range that do not have the mark name ‘m’.

1,$'mcommandGlobal on markname
Similar to the ‘g’ prefix except that ‘command’ is performed for all lines in the range that have the mark name ‘m’.

.:Display next page
The next screenful of the buffer is displayed and the current line pointer is placed at the top of the window.

none![!|<Shell_command>]Shell Escape
If present, the shell command is passed to the shell to be executed. Otherwise, an interactive shell is created. For a command, se asks you to type a newline before redrawing the screen, but for an interactive shell, se will redraw the screen immediately. If the shell command is a ‘!’, then the ‘!’ is replaced with the text of the previous shell command. An unescaped ‘%’ in the shell command will be replaced with the current saved file name. If the shell command is expanded, se will echo it first, and then execute it.

The se editor only accepts commands in upper case when absolute line numbers are turned on. This is because upper case letters are used to represent lines on the screen when in relative line number mode.