4. EX COMMAND MODE

Ex is an editing mode in which elvis acts like a line editor. This means that you type in a command line, and when the line is complete elvis executes it on the current text buffer. I.e., in ex each line (or group of lines) is a command, as opposed to vi where each character (or group of characters) is a command.

Typically, ex commands are used to do perform complex actions such as global search & replace, or actions which require an argument such as writing the edit buffer out to a different file.

Ex is also used as the configuration language for elvis; configuration scripts such as elvis.ini, .exrc (or elvis.rc), and elvis.arf contain a series of ex commands.

You can switch freely between vi and ex. If you're in vi mode, you can enter a single ex command line via the visual : command, or more permanently switch via the visual Q command. If you're in ex mode, you can switch to vi mode via ex's :vi command.

Normally elvis will start in vi mode, but you can force it to start in ex mode by supplying a -e command line flag. On UNIX systems, you can link elvis to a name which ends with "x" to achieve the same effect.

The remainder of this section discusses how to enter lines, the general syntax of an ex command line, and the specific commands which elvis supports.

4.1 Entering lines

In elvis, when you're typing in an ex command line you're really inputting text into a buffer named "Elvis ex history". All of the usual input mode commands are available, including Backspace to erase the previous character, Control-W to erase the previous word, and so on.

Any previously entered lines will still be in the "Elvis ex history" buffer, and you can use the arrow keys to move back and edit earlier commands. You can even use the Control-O input-mode command with the ?regexp visual command, to search for an earlier command line.

The Tab key has a special function when you're inputting text into the "Elvis ex history" buffer. It is used for file name expansion. The preceding word is assumed to be a partial file name, and elvis searches for all matching files. If there are multiple matches, then elvis fills in as many characters of the name as possible, and then beeps; or, if no additional characters are implied by the matching file names, then elvis lists all matching names and redisplays the command line. If there is a single match, then elvis completes the name and appends a tab character. If there are no matches, then elvis simply inserts a tab character.

You can bypass the file name expansion by typing a Control-V before the Tab key. You can also disable file name completion all together by setting the "Elvis ex history" buffer's inputtab option to "tab", via the following command:

	:(Elvis ex history)set inputtab=tab

When you hit the Enter key on a line in the "Elvis ex history" buffer, elvis sends that line to the ex command parser, which is described in the next section.

4.2 Syntax and Addressing

In general, ex command lines can begin with an optional window id. This may be followed by an optional buffer id, and then 0, 1, or 2 line addresses, followed by a command name, and perhaps some arguments after that (depending on the command name).

A window ID is typed in as a decimal number followed by a colon character. If you don't supply a window ID (and you almost never will) then it defaults to the window where you typed in the command line. The :buffer command lists the buffers, and shows which one is being edited in which window. Also, the windowid option indicates the ID of the current window.

A buffer ID is given by typing an opening parenthesis, the name of the buffer, and a closing parenthesis. For user buffers, the name of the buffer is usually identical to the name of the file that it corresponds to. For example, a file named ~/.Xdefaults would be loaded into a buffer which could be addressed as (~/.Xdefaults). Elvis also assigns numbers to user buffers, which may be more convenient to type since numbers are generally shorter than names. If ~/.Xdefaults is the first file you've edited since starting elvis, then its buffer could be addressed as (1). The :buffer command shows the number for each user buffer.

Elvis also has several internal buffers, all of which have names that start with "Elvis ", such as (Elvis cut buffer x) and (Elvis error list). The :buffer! command (with a ! suffix) will list them all. For the sake of brevity, elvis allows you to refer to cut buffers as ("x). Similarly, the other internal buffers can be referred to via a " character and the initial letter in each word of the full name, such as ("Eel) for (Elvis error list).

Commands which don't access the text, such as ":quit", don't allow any line addresses. Other commands, such as ":mark", only allow a single line address. Most commands, though, allow two line addresses; the command is applied to all lines between the two specified lines, inclusively. The tables below indicate how many line addresses each command allows.

Line addresses are always optional. The first line address of most commands usually defaults to the current line. The second line address usually defaults to be the same as the first line address. Exceptions are :write, :lpr, :global, and :vglobal, which act on all lines of the file by default, and :!, which acts on no lines by default.

If you use the visual V command to mark a range of lines, and then use the visual : command to execute a single ex command, then the default range affected by the ex command will be the visibly marked text.

Line addresses consist of an absolute part and a relative part. The absolute part of a line specifier may be either an explicit line number, a mark, a dot to denote the current line, a dollar sign to denote the last line of the file, or a forward or backward search. An explicit line number is simply a decimal number, expressed as a string of digits. A mark is typed in as an apostrophe followed by a letter. Marks must be set before they can be used. You can set a mark in visual command mode by typing "m" and a letter, or you can set it in ex command mode via the "mark" command. A forward search is typed in as a regular expression surrounded by slash characters; searching begins at the default line. A backward search is typed in as a regular expression surrounded by question marks; searching begins at the line before the default line.

If you omit the absolute part, then the default line is used.

The relative part of a line specifier is typed as a + or - character followed by a decimal number. The number is added to or subtracted from the absolute part of the line specifier to produce the final line number.

As a special case, the % character may be used to specify all lines of the file. It is roughly equivalent to saying 1,$. This can be a handy shortcut.

Here are some addressing examples, using the :p command:

   COMMAND      | ACTION
   -------------|-------------------------------------------
   :p           | print the current line
   :37p         | print line 37
   :'gp         | print the line which contains mark g
   :/foo/p      | print the next line that contains "foo"
   :$p          | print the last line of the buffer
   :20,30p      | print lines 20 through 30
   :1,$p        | print all lines of the buffer
   :%p          | print all lines of the buffer
   :(zot)%p     | print all lines of the "zot" buffer
   :/foo/-2,+4p | print 5 lines around the next "foo"

The optional addresses are followed by the command name. Command names may be abbreviated. In the sections that follow, the command's full name is given with the optional part enclosed in square brackets.

Some commands allow a '!' character to appear immediately after the command name. The significance of the '!' varies from one command to another, but typically it forces the command to do something dangerous that it would ordinarily refuse to do. For example, :w file refuses to overwrite an existing file, but :w! file will do it.

Many commands allow (or even require) additional arguments. The descriptions below list which arguments each command accepts with optional commands denoted by square brackets. The most common argument types are:

/regexp/
This is a regular expression. You can use any punctuation character to delimit it, but the '/' character is the most commonly used.

Note: When entering a tab character into a regular expression, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

/regexp/newtext/
This is a regular expression followed by replacement text.

Note: When entering a tab character into the replacement text, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

count
This is a number - a string of digits. Generally, it is used as the repeat count for certain commands.
cutbuf
This is the name of a cut buffer - a single letter. Elvis also allows (but does not require) a quote character before the letter.
excmds
This is another ex command, d by th value. A few other markups, described below, use the { ... } notation for their arguments.

This differs from TeX in two major ways:

\mathrelpunctuation
\charpunctuation
\punctuation
These output the punctuation character literally. In the real TeX, \mathrel is more subtle than that.
\title{text}
Display the text as a title: Centered, in the "bold" font.
\author{text}
Display the text as an author name: Centered, in the "italic" font.
\section{text}
Display the text as a section title: Starting at the leftmost column, in the "bold" font. Also, if it would be printed near the end of a page then it will be moved to the start of the next page instead.
\subsection{text}
Display the text as a subsection title: Indented slightly from the left edge, and in the "bold" font.
\hline
Draw a horizonal line across the page. Unfortunately, elvis' implementation tends to leave a blank line above the horizontal line.
\begin{table}
\hfil or \hfill or &
\cr or \\
\end{table}
These are used to present tables. \cr or \\ marks the end of each row, and \hfil, \hfill, or & mark the end of a column's data within a row. TeX actually offers other commands to control the shape of the table, but elvis doesn't support those commands.
\begin{quote}
\end{quote}
These are used to enclose a quoted paragraph. Elvis uses extra indentation while displaying the paragraph.
\begin{verbatim}
\end{verbatim}
These are used to enclose text which should be subjected to less processing; in particular, indentation and line breaks are preserved.
$$
A $$ pair toggles between the "normal" font with standard text filling, and the "fixed" font with lines displayed verbatim. This is typically used for presenting longer command-line examples on lines by themselves between paragraphs.
\begin{description}
\item[term]
\end{description}
This is used for presenting a series of terms followed by their definitions.
\begin{enumerate}
\item
\end{enumerate}
This is used for presenting a numbered list of items. Each item should be preceeded by \item.
\begin{itemize}
\item
\item[bullet]
\end{itemize}
This is used for presenting a list of items. Each item should be preceded either by \item to mark it with an asterisk, or by \item[bullet] to mark it with something other than an asterisk.
\tt
Switch to the "fixed" font. Generally, all of these font-switching commands will be used with { ... }, like this:
Normal text {\tt Fixed-font text} Normal again.
\bf
Switch to the "bold" font.
\em
\it
Switch to the "italic" font.
\fo
This is a common macro which indicates the following text is in a foreign language. Elvis supports it; it switches to the "italic" font.
$
A single $ character toggles between the "normal" font and the "fixed" font. This is often used for marking computer commands in the body of a paragraph.

7.7.2 Unsupported TeX markups

The following describes how elvis deals with certain unsupported features of TeX.
\vspace{value}
This is treated like a paragraph break.
\footnote{text}
The footnote is completely hidden, including its text.
\halign...
\begin{tabular}...
\multicolumn...
\set...
\def...
\new...
\catcode...
\document...
\other=...
Everything up to the end of the line is skipped. Other than that, the markup has no effect.
\other{text}
The markup and its text are ignored.
\other
Unrecognized markups are generally ignored. The single big exception is that if the markup is followed by punctuation or a backslash-space pair, then elvis assumes the markup is probably just an abbreviation for some word or phrase which is supposed to be displayed in a special font; so elvis displays the markup's name (without the leading backslash) in the "bold" font.
usr/doc/elvis/elvisex.html100644 0 0 251673 6502273123 14260 0ustar rootroot Elvis 2.1 Ex Mode

4. EX COMMAND MODE

Ex is an editing mode in which elvis acts like a line editor. This means that you type in a command line, and when the line is complete elvis executes it on the current text buffer. I.e., in ex each line (or group of lines) is a command, as opposed to vi where each character (or group of characters) is a command.

Typically, ex commands are used to do perform complex actions such as global search & replace, or actions which require an argument such as writing the edit buffer out to a different file.

Ex is also used as the configuration language for elvis; configuration scripts such as elvis.ini, .exrc (or elvis.rc), and elvis.arf contain a series of ex commands.

You can switch freely between vi and ex. If you're in vi mode, you can enter a single ex command line via the visual : command, or more permanently switch via the visual Q command. If you're in ex mode, you can switch to vi mode via ex's :vi command.

Normally elvis will start in vi mode, but you can force it to start in ex mode by supplying a -e command line flag. On UNIX systems, you can link elvis to a name which ends with "x" to achieve the same effect.

The remainder of this section discusses how to enter lines, the general syntax of an ex command line, and the specific commands which elvis supports.

4.1 Entering lines

In elvis, when you're typing in an ex command line you're really inputting text into a buffer named "Elvis ex history". All of the usual input mode commands are available, including Backspace to erase the previous character, Control-W to erase the previous word, and so on.

Any previously entered lines will still be in the "Elvis ex history" buffer, and you can use the arrow keys to move back and edit earlier commands. You can even use the Control-O input-mode command with the ?regexp visual command, to search for an earlier command line.

The Tab key has a special function when you're inputting text into the "Elvis ex history" buffer. It is used for file name expansion. The preceding word is assumed to be a partial file name, and elvis searches for all matching files. If there are multiple matches, then elvis fills in as many characters of the name as possible, and then beeps; or, if no additional characters are implied by the matching file names, then elvis lists all matching names and redisplays the command line. If there is a single match, then elvis completes the name and appends a tab character. If there are no matches, then elvis simply inserts a tab character.

You can bypass the file name expansion by typing a Control-V before the Tab key. You can also disable file name completion all together by setting the "Elvis ex history" buffer's inputtab option to "tab", via the following command:

	:(Elvis ex history)set inputtab=tab

When you hit the Enter key on a line in the "Elvis ex history" buffer, elvis sends that line to the ex command parser, which is described in the next section.

4.2 Syntax and Addressing

In general, ex command lines can begin with an optional window id. This may be followed by an optional buffer id, and then 0, 1, or 2 line addresses, followed by a command name, and perhaps some arguments after that (depending on the command name).

A window ID is typed in as a decimal number followed by a colon character. If you don't supply a window ID (and you almost never will) then it defaults to the window where you typed in the command line. The :buffer command lists the buffers, and shows which one is being edited in which window. Also, the windowid option indicates the ID of the current window.

A buffer ID is given by typing an opening parenthesis, the name of the buffer, and a closing parenthesis. For user buffers, the name of the buffer is usually identical to the name of the file that it corresponds to. For example, a file named ~/.Xdefaults would be loaded into a buffer which could be addressed as (~/.Xdefaults). Elvis also assigns numbers to user buffers, which may be more convenient to type since numbers are generally shorter than names. If ~/.Xdefaults is the first file you've edited since starting elvis, then its buffer could be addressed as (1). The :buffer command shows the number for each user buffer.

Elvis also has several internal buffers, all of which have names that start with "Elvis ", such as (Elvis cut buffer x) and (Elvis error list). The :buffer! command (with a ! suffix) will list them all. For the sake of brevity, elvis allows you to refer to cut buffers as ("x). Similarly, the other internal buffers can be referred to via a " character and the initial letter in each word of the full name, such as ("Eel) for (Elvis error list).

Commands which don't access the text, such as ":quit", don't allow any line addresses. Other commands, such as ":mark", only allow a single line address. Most commands, though, allow two line addresses; the command is applied to all lines between the two specified lines, inclusively. The tables below indicate how many line addresses each command allows.

Line addresses are always optional. The first line address of most commands usually defaults to the current line. The second line address usually defaults to be the same as the first line address. Exceptions are :write, :lpr, :global, and :vglobal, which act on all lines of the file by default, and :!, which acts on no lines by default.

If you use the visual V command to mark a range of lines, and then use the visual : command to execute a single ex command, then the default range affected by the ex command will be the visibly marked text.

Line addresses consist of an absolute part and a relative part. The absolute part of a line specifier may be either an explicit line number, a mark, a dot to denote the current line, a dollar sign to denote the last line of the file, or a forward or backward search. An explicit line number is simply a decimal number, expressed as a string of digits. A mark is typed in as an apostrophe followed by a letter. Marks must be set before they can be used. You can set a mark in visual command mode by typing "m" and a letter, or you can set it in ex command mode via the "mark" command. A forward search is typed in as a regular expression surrounded by slash characters; searching begins at the default line. A backward search is typed in as a regular expression surrounded by question marks; searching begins at the line before the default line.

If you omit the absolute part, then the default line is used.

The relative part of a line specifier is typed as a + or - character followed by a decimal number. The number is added to or subtracted from the absolute part of the line specifier to produce the final line number.

As a special case, the % character may be used to specify all lines of the file. It is roughly equivalent to saying 1,$. This can be a handy shortcut.

Here are some addressing examples, using the :p command:

   COMMAND      | ACTION
   -------------|-------------------------------------------
   :p           | print the current line
   :37p         | print line 37
   :'gp         | print the line which contains mark g
   :/foo/p      | print the next line that contains "foo"
   :$p          | print the last line of the buffer
   :20,30p      | print lines 20 through 30
   :1,$p        | print all lines of the buffer
   :%p          | print all lines of the buffer
   :(zot)%p     | print all lines of the "zot" buffer
   :/foo/-2,+4p | print 5 lines around the next "foo"

The optional addresses are followed by the command name. Command names may be abbreviated. In the sections that follow, the command's full name is given with the optional part enclosed in square brackets.

Some commands allow a '!' character to appear immediately after the command name. The significance of the '!' varies from one command to another, but typically it forces the command to do something dangerous that it would ordinarily refuse to do. For example, :w file refuses to overwrite an existing file, but :w! file will do it.

Many commands allow (or even require) additional arguments. The descriptions below list which arguments each command accepts with optional commands denoted by square brackets. The most common argument types are:

/regexp/
This is a regular expression. You can use any punctuation character to delimit it, but the '/' character is the most commonly used.

Note: When entering a tab character into a regular expression, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

/regexp/newtext/
This is a regular expression followed by replacement text.

Note: When entering a tab character into the replacement text, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

count
This is a number - a string of digits. Generally, it is used as the repeat count for certain commands.
cutbuf
This is the name of a cut buffer - a single letter. Elvis also allows (but does not require) a quote character before the letter.
excmds
This is another ex command, d by th value. A few other markups, described below, use the { ... } notation for their arguments.

This differs from TeX in two major ways:

\mathrelpunctuation
\charpunctuation
\punctuation
These output the punctuation character literally. In the real TeX, \mathrel is more subtle than that.
\title{text}
Display the text as a title: Centered, in the "bold" font.
\author{text}
Display the text as an author name: Centered, in the "italic" font.
\section{text}
Display the text as a section title: Starting at the leftmost column, in the "bold" font. Also, if it would be printed near the end of a page then it will be moved to the start of the next page instead.
\subsection{text}
Display the text as a subsection title: Indented slightly from the left edge, and in the "bold" font.
\hline
Draw a horizonal line across the page. Unfortunately, elvis' implementation tends to leave a blank line above the horizontal line.
\begin{table}
\hfil or \hfill or &
\cr or \\
\end{table}
These are used to present tables. \cr or \\ marks the end of each row, and \hfil, \hfill, or & mark the end of a column's data within a row. TeX actually offers other commands to control the shape of the table, but elvis doesn't support those commands.
\begin{quote}
\end{quote}
These are used to enclose a quoted paragraph. Elvis uses extra indentation while displaying the paragraph.
\begin{verbatim}
\end{verbatim}
These are used to enclose text which should be subjected to less processing; in particular, indentation and line breaks are preserved.
$$
A $$ pair toggles between the "normal" font with standard text filling, and the "fixed" font with lines displayed verbatim. This is typically used for presenting longer command-line examples on lines by themselves between paragraphs.
\begin{description}
\item[term]
\end{description}
This is used for presenting a series of terms followed by their definitions.
\begin{enumerate}
\item
\end{enumerate}
This is used for presenting a numbered list of items. Each item should be preceeded by \item.
\begin{itemize}
\item
\item[bullet]
\end{itemize}
This is used for presenting a list of items. Each item should be preceded either by \item to mark it with an asterisk, or by \item[bullet] to mark it with something other than an asterisk.
\tt
Switch to the "fixed" font. Generally, all of these font-switching commands will be used with { ... }, like this:
Normal text {\tt Fixed-font text} Normal again.
\bf
Switch to the "bold" font.
\em
\it
Switch to the "italic" font.
\fo
This is a common macro which indicates the following text is in a foreign language. Elvis supports it; it switches to the "italic" font.
$
A single $ character toggles between the "normal" font and the "fixed" font. This is often used for marking computer commands in the body of a paragraph.

7.7.2 Unsupported TeX markups

The following describes how elvis deals with certain unsupported features of TeX.
\vspace{value}
This is treated like a paragraph break.
\footnote{text}
The footnote is completely hidden, including its text.
\halign...
\begin{tabular}...
\multicolumn...
\set...
\def...
\new...
\catcode...
\document...
\other=...
Everything up to the end of the line is skipped. Other than that, the markup has no effect.
\other{text}
The markup and its text are ignored.
\other
Unrecognized markups are generally ignored. The single big exception is that if the markup is followed by punctuation or a backslash-space pair, then elvis assumes the markup is probably just an abbreviation for some word or phrase which is supposed to be displayed in a special font; so elvis displays the markup's name (without the leading backslash) in the "bold" font.
usr/doc/elvis/elvisex.html100644 0 0 251673 6502273123 14260 0ustar rootroot Elvis 2.1 Ex Mode

4. EX COMMAND MODE

Ex is an editing mode in which elvis acts like a line editor. This means that you type in a command line, and when the line is complete elvis executes it on the current text buffer. I.e., in ex each line (or group of lines) is a command, as opposed to vi where each character (or group of characters) is a command.

Typically, ex commands are used to do perform complex actions such as global search & replace, or actions which require an argument such as writing the edit buffer out to a different file.

Ex is also used as the configuration language for elvis; configuration scripts such as elvis.ini, .exrc (or elvis.rc), and elvis.arf contain a series of ex commands.

You can switch freely between vi and ex. If you're in vi mode, you can enter a single ex command line via the visual : command, or more permanently switch via the visual Q command. If you're in ex mode, you can switch to vi mode via ex's :vi command.

Normally elvis will start in vi mode, but you can force it to start in ex mode by supplying a -e command line flag. On UNIX systems, you can link elvis to a name which ends with "x" to achieve the same effect.

The remainder of this section discusses how to enter lines, the general syntax of an ex command line, and the specific commands which elvis supports.

4.1 Entering lines

In elvis, when you're typing in an ex command line you're really inputting text into a buffer named "Elvis ex history". All of the usual input mode commands are available, including Backspace to erase the previous character, Control-W to erase the previous word, and so on.

Any previously entered lines will still be in the "Elvis ex history" buffer, and you can use the arrow keys to move back and edit earlier commands. You can even use the Control-O input-mode command with the ?regexp visual command, to search for an earlier command line.

The Tab key has a special function when you're inputting text into the "Elvis ex history" buffer. It is used for file name expansion. The preceding word is assumed to be a partial file name, and elvis searches for all matching files. If there are multiple matches, then elvis fills in as many characters of the name as possible, and then beeps; or, if no additional characters are implied by the matching file names, then elvis lists all matching names and redisplays the command line. If there is a single match, then elvis completes the name and appends a tab character. If there are no matches, then elvis simply inserts a tab character.

You can bypass the file name expansion by typing a Control-V before the Tab key. You can also disable file name completion all together by setting the "Elvis ex history" buffer's inputtab option to "tab", via the following command:

	:(Elvis ex history)set inputtab=tab

When you hit the Enter key on a line in the "Elvis ex history" buffer, elvis sends that line to the ex command parser, which is described in the next section.

4.2 Syntax and Addressing

In general, ex command lines can begin with an optional window id. This may be followed by an optional buffer id, and then 0, 1, or 2 line addresses, followed by a command name, and perhaps some arguments after that (depending on the command name).

A window ID is typed in as a decimal number followed by a colon character. If you don't supply a window ID (and you almost never will) then it defaults to the window where you typed in the command line. The :buffer command lists the buffers, and shows which one is being edited in which window. Also, the windowid option indicates the ID of the current window.

A buffer ID is given by typing an opening parenthesis, the name of the buffer, and a closing parenthesis. For user buffers, the name of the buffer is usually identical to the name of the file that it corresponds to. For example, a file named ~/.Xdefaults would be loaded into a buffer which could be addressed as (~/.Xdefaults). Elvis also assigns numbers to user buffers, which may be more convenient to type since numbers are generally shorter than names. If ~/.Xdefaults is the first file you've edited since starting elvis, then its buffer could be addressed as (1). The :buffer command shows the number for each user buffer.

Elvis also has several internal buffers, all of which have names that start with "Elvis ", such as (Elvis cut buffer x) and (Elvis error list). The :buffer! command (with a ! suffix) will list them all. For the sake of brevity, elvis allows you to refer to cut buffers as ("x). Similarly, the other internal buffers can be referred to via a " character and the initial letter in each word of the full name, such as ("Eel) for (Elvis error list).

Commands which don't access the text, such as ":quit", don't allow any line addresses. Other commands, such as ":mark", only allow a single line address. Most commands, though, allow two line addresses; the command is applied to all lines between the two specified lines, inclusively. The tables below indicate how many line addresses each command allows.

Line addresses are always optional. The first line address of most commands usually defaults to the current line. The second line address usually defaults to be the same as the first line address. Exceptions are :write, :lpr, :global, and :vglobal, which act on all lines of the file by default, and :!, which acts on no lines by default.

If you use the visual V command to mark a range of lines, and then use the visual : command to execute a single ex command, then the default range affected by the ex command will be the visibly marked text.

Line addresses consist of an absolute part and a relative part. The absolute part of a line specifier may be either an explicit line number, a mark, a dot to denote the current line, a dollar sign to denote the last line of the file, or a forward or backward search. An explicit line number is simply a decimal number, expressed as a string of digits. A mark is typed in as an apostrophe followed by a letter. Marks must be set before they can be used. You can set a mark in visual command mode by typing "m" and a letter, or you can set it in ex command mode via the "mark" command. A forward search is typed in as a regular expression surrounded by slash characters; searching begins at the default line. A backward search is typed in as a regular expression surrounded by question marks; searching begins at the line before the default line.

If you omit the absolute part, then the default line is used.

The relative part of a line specifier is typed as a + or - character followed by a decimal number. The number is added to or subtracted from the absolute part of the line specifier to produce the final line number.

As a special case, the % character may be used to specify all lines of the file. It is roughly equivalent to saying 1,$. This can be a handy shortcut.

Here are some addressing examples, using the :p command:

   COMMAND      | ACTION
   -------------|-------------------------------------------
   :p           | print the current line
   :37p         | print line 37
   :'gp         | print the line which contains mark g
   :/foo/p      | print the next line that contains "foo"
   :$p          | print the last line of the buffer
   :20,30p      | print lines 20 through 30
   :1,$p        | print all lines of the buffer
   :%p          | print all lines of the buffer
   :(zot)%p     | print all lines of the "zot" buffer
   :/foo/-2,+4p | print 5 lines around the next "foo"

The optional addresses are followed by the command name. Command names may be abbreviated. In the sections that follow, the command's full name is given with the optional part enclosed in square brackets.

Some commands allow a '!' character to appear immediately after the command name. The significance of the '!' varies from one command to another, but typically it forces the command to do something dangerous that it would ordinarily refuse to do. For example, :w file refuses to overwrite an existing file, but :w! file will do it.

Many commands allow (or even require) additional arguments. The descriptions below list which arguments each command accepts with optional commands denoted by square brackets. The most common argument types are:

/regexp/
This is a regular expression. You can use any punctuation character to delimit it, but the '/' character is the most commonly used.

Note: When entering a tab character into a regular expression, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

/regexp/newtext/
This is a regular expression followed by replacement text.

Note: When entering a tab character into the replacement text, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

count
This is a number - a string of digits. Generally, it is used as the repeat count for certain commands.
cutbuf
This is the name of a cut buffer - a single letter. Elvis also allows (but does not require) a quote character before the letter.
excmds
This is another ex command, d by th value. A few other markups, described below, use the { ... } notation for their arguments.

This differs from TeX in two major ways:

\mathrelpunctuation
\charpunctuation
\punctuation
These output the punctuation character literally. In the real TeX, \mathrel is more subtle than that.
\title{text}
Display the text as a title: Centered, in the "bold" font.
\author{text}
Display the text as an author name: Centered, in the "italic" font.
\section{text}
Display the text as a section title: Starting at the leftmost column, in the "bold" font. Also, if it would be printed near the end of a page then it will be moved to the start of the next page instead.
\subsection{text}
Display the text as a subsection title: Indented slightly from the left edge, and in the "bold" font.
\hline
Draw a horizonal line across the page. Unfortunately, elvis' implementation tends to leave a blank line above the horizontal line.
\begin{table}
\hfil or \hfill or &
\cr or \\
\end{table}
These are used to present tables. \cr or \\ marks the end of each row, and \hfil, \hfill, or & mark the end of a column's data within a row. TeX actually offers other commands to control the shape of the table, but elvis doesn't support those commands.
\begin{quote}
\end{quote}
These are used to enclose a quoted paragraph. Elvis uses extra indentation while displaying the paragraph.
\begin{verbatim}
\end{verbatim}
These are used to enclose text which should be subjected to less processing; in particular, indentation and line breaks are preserved.
$$
A $$ pair toggles between the "normal" font with standard text filling, and the "fixed" font with lines displayed verbatim. This is typically used for presenting longer command-line examples on lines by themselves between paragraphs.
\begin{description}
\item[term]
\end{description}
This is used for presenting a series of terms followed by their definitions.
\begin{enumerate}
\item
\end{enumerate}
This is used for presenting a numbered list of items. Each item should be preceeded by \item.
\begin{itemize}
\item
\item[bullet]
\end{itemize}
This is used for presenting a list of items. Each item should be preceded either by \item to mark it with an asterisk, or by \item[bullet] to mark it with something other than an asterisk.
\tt
Switch to the "fixed" font. Generally, all of these font-switching commands will be used with { ... }, like this:
Normal text {\tt Fixed-font text} Normal again.
\bf
Switch to the "bold" font.
\em
\it
Switch to the "italic" font.
\fo
This is a common macro which indicates the following text is in a foreign language. Elvis supports it; it switches to the "italic" font.
$
A single $ character toggles between the "normal" font and the "fixed" font. This is often used for marking computer commands in the body of a paragraph.

7.7.2 Unsupported TeX markups

The following describes how elvis deals with certain unsupported features of TeX.
\vspace{value}
This is treated like a paragraph break.
\footnote{text}
The footnote is completely hidden, including its text.
\halign...
\begin{tabular}...
\multicolumn...
\set...
\def...
\new...
\catcode...
\document...
\other=...
Everything up to the end of the line is skipped. Other than that, the markup has no effect.
\other{text}
The markup and its text are ignored.
\other
Unrecognized markups are generally ignored. The single big exception is that if the markup is followed by punctuation or a backslash-space pair, then elvis assumes the markup is probably just an abbreviation for some word or phrase which is supposed to be displayed in a special font; so elvis displays the markup's name (without the leading backslash) in the "bold" font.
usr/doc/elvis/elvisex.html100644 0 0 251673 6502273123 14260 0ustar rootroot Elvis 2.1 Ex Mode

4. EX COMMAND MODE

Ex is an editing mode in which elvis acts like a line editor. This means that you type in a command line, and when the line is complete elvis executes it on the current text buffer. I.e., in ex each line (or group of lines) is a command, as opposed to vi where each character (or group of characters) is a command.

Typically, ex commands are used to do perform complex actions such as global search & replace, or actions which require an argument such as writing the edit buffer out to a different file.

Ex is also used as the configuration language for elvis; configuration scripts such as elvis.ini, .exrc (or elvis.rc), and elvis.arf contain a series of ex commands.

You can switch freely between vi and ex. If you're in vi mode, you can enter a single ex command line via the visual : command, or more permanently switch via the visual Q command. If you're in ex mode, you can switch to vi mode via ex's :vi command.

Normally elvis will start in vi mode, but you can force it to start in ex mode by supplying a -e command line flag. On UNIX systems, you can link elvis to a name which ends with "x" to achieve the same effect.

The remainder of this section discusses how to enter lines, the general syntax of an ex command line, and the specific commands which elvis supports.

4.1 Entering lines

In elvis, when you're typing in an ex command line you're really inputting text into a buffer named "Elvis ex history". All of the usual input mode commands are available, including Backspace to erase the previous character, Control-W to erase the previous word, and so on.

Any previously entered lines will still be in the "Elvis ex history" buffer, and you can use the arrow keys to move back and edit earlier commands. You can even use the Control-O input-mode command with the ?regexp visual command, to search for an earlier command line.

The Tab key has a special function when you're inputting text into the "Elvis ex history" buffer. It is used for file name expansion. The preceding word is assumed to be a partial file name, and elvis searches for all matching files. If there are multiple matches, then elvis fills in as many characters of the name as possible, and then beeps; or, if no additional characters are implied by the matching file names, then elvis lists all matching names and redisplays the command line. If there is a single match, then elvis completes the name and appends a tab character. If there are no matches, then elvis simply inserts a tab character.

You can bypass the file name expansion by typing a Control-V before the Tab key. You can also disable file name completion all together by setting the "Elvis ex history" buffer's inputtab option to "tab", via the following command:

	:(Elvis ex history)set inputtab=tab

When you hit the Enter key on a line in the "Elvis ex history" buffer, elvis sends that line to the ex command parser, which is described in the next section.

4.2 Syntax and Addressing

In general, ex command lines can begin with an optional window id. This may be followed by an optional buffer id, and then 0, 1, or 2 line addresses, followed by a command name, and perhaps some arguments after that (depending on the command name).

A window ID is typed in as a decimal number followed by a colon character. If you don't supply a window ID (and you almost never will) then it defaults to the window where you typed in the command line. The :buffer command lists the buffers, and shows which one is being edited in which window. Also, the windowid option indicates the ID of the current window.

A buffer ID is given by typing an opening parenthesis, the name of the buffer, and a closing parenthesis. For user buffers, the name of the buffer is usually identical to the name of the file that it corresponds to. For example, a file named ~/.Xdefaults would be loaded into a buffer which could be addressed as (~/.Xdefaults). Elvis also assigns numbers to user buffers, which may be more convenient to type since numbers are generally shorter than names. If ~/.Xdefaults is the first file you've edited since starting elvis, then its buffer could be addressed as (1). The :buffer command shows the number for each user buffer.

Elvis also has several internal buffers, all of which have names that start with "Elvis ", such as (Elvis cut buffer x) and (Elvis error list). The :buffer! command (with a ! suffix) will list them all. For the sake of brevity, elvis allows you to refer to cut buffers as ("x). Similarly, the other internal buffers can be referred to via a " character and the initial letter in each word of the full name, such as ("Eel) for (Elvis error list).

Commands which don't access the text, such as ":quit", don't allow any line addresses. Other commands, such as ":mark", only allow a single line address. Most commands, though, allow two line addresses; the command is applied to all lines between the two specified lines, inclusively. The tables below indicate how many line addresses each command allows.

Line addresses are always optional. The first line address of most commands usually defaults to the current line. The second line address usually defaults to be the same as the first line address. Exceptions are :write, :lpr, :global, and :vglobal, which act on all lines of the file by default, and :!, which acts on no lines by default.

If you use the visual V command to mark a range of lines, and then use the visual : command to execute a single ex command, then the default range affected by the ex command will be the visibly marked text.

Line addresses consist of an absolute part and a relative part. The absolute part of a line specifier may be either an explicit line number, a mark, a dot to denote the current line, a dollar sign to denote the last line of the file, or a forward or backward search. An explicit line number is simply a decimal number, expressed as a string of digits. A mark is typed in as an apostrophe followed by a letter. Marks must be set before they can be used. You can set a mark in visual command mode by typing "m" and a letter, or you can set it in ex command mode via the "mark" command. A forward search is typed in as a regular expression surrounded by slash characters; searching begins at the default line. A backward search is typed in as a regular expression surrounded by question marks; searching begins at the line before the default line.

If you omit the absolute part, then the default line is used.

The relative part of a line specifier is typed as a + or - character followed by a decimal number. The number is added to or subtracted from the absolute part of the line specifier to produce the final line number.

As a special case, the % character may be used to specify all lines of the file. It is roughly equivalent to saying 1,$. This can be a handy shortcut.

Here are some addressing examples, using the :p command:

   COMMAND      | ACTION
   -------------|-------------------------------------------
   :p           | print the current line
   :37p         | print line 37
   :'gp         | print the line which contains mark g
   :/foo/p      | print the next line that contains "foo"
   :$p          | print the last line of the buffer
   :20,30p      | print lines 20 through 30
   :1,$p        | print all lines of the buffer
   :%p          | print all lines of the buffer
   :(zot)%p     | print all lines of the "zot" buffer
   :/foo/-2,+4p | print 5 lines around the next "foo"

The optional addresses are followed by the command name. Command names may be abbreviated. In the sections that follow, the command's full name is given with the optional part enclosed in square brackets.

Some commands allow a '!' character to appear immediately after the command name. The significance of the '!' varies from one command to another, but typically it forces the command to do something dangerous that it would ordinarily refuse to do. For example, :w file refuses to overwrite an existing file, but :w! file will do it.

Many commands allow (or even require) additional arguments. The descriptions below list which arguments each command accepts with optional commands denoted by square brackets. The most common argument types are:

/regexp/
This is a regular expression. You can use any punctuation character to delimit it, but the '/' character is the most commonly used.

Note: When entering a tab character into a regular expression, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

/regexp/newtext/
This is a regular expression followed by replacement text.

Note: When entering a tab character into the replacement text, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

count
This is a number - a string of digits. Generally, it is used as the repeat count for certain commands.
cutbuf
This is the name of a cut buffer - a single letter. Elvis also allows (but does not require) a quote character before the letter.
excmds
This is another ex command, d by th value. A few other markups, described below, use the { ... } notation for their arguments.

This differs from TeX in two major ways:

\mathrelpunctuation
\charpunctuation
\punctuation
These output the punctuation character literally. In the real TeX, \mathrel is more subtle than that.
\title{text}
Display the text as a title: Centered, in the "bold" font.
\author{text}
Display the text as an author name: Centered, in the "italic" font.
\section{text}
Display the text as a section title: Starting at the leftmost column, in the "bold" font. Also, if it would be printed near the end of a page then it will be moved to the start of the next page instead.
\subsection{text}
Display the text as a subsection title: Indented slightly from the left edge, and in the "bold" font.
\hline
Draw a horizonal line across the page. Unfortunately, elvis' implementation tends to leave a blank line above the horizontal line.
\begin{table}
\hfil or \hfill or &
\cr or \\
\end{table}
These are used to present tables. \cr or \\ marks the end of each row, and \hfil, \hfill, or & mark the end of a column's data within a row. TeX actually offers other commands to control the shape of the table, but elvis doesn't support those commands.
\begin{quote}
\end{quote}
These are used to enclose a quoted paragraph. Elvis uses extra indentation while displaying the paragraph.
\begin{verbatim}
\end{verbatim}
These are used to enclose text which should be subjected to less processing; in particular, indentation and line breaks are preserved.
$$
A $$ pair toggles between the "normal" font with standard text filling, and the "fixed" font with lines displayed verbatim. This is typically used for presenting longer command-line examples on lines by themselves between paragraphs.
\begin{description}
\item[term]
\end{description}
This is used for presenting a series of terms followed by their definitions.
\begin{enumerate}
\item
\end{enumerate}
This is used for presenting a numbered list of items. Each item should be preceeded by \item.
\begin{itemize}
\item
\item[bullet]
\end{itemize}
This is used for presenting a list of items. Each item should be preceded either by \item to mark it with an asterisk, or by \item[bullet] to mark it with something other than an asterisk.
\tt
Switch to the "fixed" font. Generally, all of these font-switching commands will be used with { ... }, like this:
Normal text {\tt Fixed-font text} Normal again.
\bf
Switch to the "bold" font.
\em
\it
Switch to the "italic" font.
\fo
This is a common macro which indicates the following text is in a foreign language. Elvis supports it; it switches to the "italic" font.
$
A single $ character toggles between the "normal" font and the "fixed" font. This is often used for marking computer commands in the body of a paragraph.

7.7.2 Unsupported TeX markups

The following describes how elvis deals with certain unsupported features of TeX.
\vspace{value}
This is treated like a paragraph break.
\footnote{text}
The footnote is completely hidden, including its text.
\halign...
\begin{tabular}...
\multicolumn...
\set...
\def...
\new...
\catcode...
\document...
\other=...
Everything up to the end of the line is skipped. Other than that, the markup has no effect.
\other{text}
The markup and its text are ignored.
\other
Unrecognized markups are generally ignored. The single big exception is that if the markup is followed by punctuation or a backslash-space pair, then elvis assumes the markup is probably just an abbreviation for some word or phrase which is supposed to be displayed in a special font; so elvis displays the markup's name (without the leading backslash) in the "bold" font.
usr/doc/elvis/elvisex.html100644 0 0 251673 6502273123 14260 0ustar rootroot Elvis 2.1 Ex Mode

4. EX COMMAND MODE

Ex is an editing mode in which elvis acts like a line editor. This means that you type in a command line, and when the line is complete elvis executes it on the current text buffer. I.e., in ex each line (or group of lines) is a command, as opposed to vi where each character (or group of characters) is a command.

Typically, ex commands are used to do perform complex actions such as global search & replace, or actions which require an argument such as writing the edit buffer out to a different file.

Ex is also used as the configuration language for elvis; configuration scripts such as elvis.ini, .exrc (or elvis.rc), and elvis.arf contain a series of ex commands.

You can switch freely between vi and ex. If you're in vi mode, you can enter a single ex command line via the visual : command, or more permanently switch via the visual Q command. If you're in ex mode, you can switch to vi mode via ex's :vi command.

Normally elvis will start in vi mode, but you can force it to start in ex mode by supplying a -e command line flag. On UNIX systems, you can link elvis to a name which ends with "x" to achieve the same effect.

The remainder of this section discusses how to enter lines, the general syntax of an ex command line, and the specific commands which elvis supports.

4.1 Entering lines

In elvis, when you're typing in an ex command line you're really inputting text into a buffer named "Elvis ex history". All of the usual input mode commands are available, including Backspace to erase the previous character, Control-W to erase the previous word, and so on.

Any previously entered lines will still be in the "Elvis ex history" buffer, and you can use the arrow keys to move back and edit earlier commands. You can even use the Control-O input-mode command with the ?regexp visual command, to search for an earlier command line.

The Tab key has a special function when you're inputting text into the "Elvis ex history" buffer. It is used for file name expansion. The preceding word is assumed to be a partial file name, and elvis searches for all matching files. If there are multiple matches, then elvis fills in as many characters of the name as possible, and then beeps; or, if no additional characters are implied by the matching file names, then elvis lists all matching names and redisplays the command line. If there is a single match, then elvis completes the name and appends a tab character. If there are no matches, then elvis simply inserts a tab character.

You can bypass the file name expansion by typing a Control-V before the Tab key. You can also disable file name completion all together by setting the "Elvis ex history" buffer's inputtab option to "tab", via the following command:

	:(Elvis ex history)set inputtab=tab

When you hit the Enter key on a line in the "Elvis ex history" buffer, elvis sends that line to the ex command parser, which is described in the next section.

4.2 Syntax and Addressing

In general, ex command lines can begin with an optional window id. This may be followed by an optional buffer id, and then 0, 1, or 2 line addresses, followed by a command name, and perhaps some arguments after that (depending on the command name).

A window ID is typed in as a decimal number followed by a colon character. If you don't supply a window ID (and you almost never will) then it defaults to the window where you typed in the command line. The :buffer command lists the buffers, and shows which one is being edited in which window. Also, the windowid option indicates the ID of the current window.

A buffer ID is given by typing an opening parenthesis, the name of the buffer, and a closing parenthesis. For user buffers, the name of the buffer is usually identical to the name of the file that it corresponds to. For example, a file named ~/.Xdefaults would be loaded into a buffer which could be addressed as (~/.Xdefaults). Elvis also assigns numbers to user buffers, which may be more convenient to type since numbers are generally shorter than names. If ~/.Xdefaults is the first file you've edited since starting elvis, then its buffer could be addressed as (1). The :buffer command shows the number for each user buffer.

Elvis also has several internal buffers, all of which have names that start with "Elvis ", such as (Elvis cut buffer x) and (Elvis error list). The :buffer! command (with a ! suffix) will list them all. For the sake of brevity, elvis allows you to refer to cut buffers as ("x). Similarly, the other internal buffers can be referred to via a " character and the initial letter in each word of the full name, such as ("Eel) for (Elvis error list).

Commands which don't access the text, such as ":quit", don't allow any line addresses. Other commands, such as ":mark", only allow a single line address. Most commands, though, allow two line addresses; the command is applied to all lines between the two specified lines, inclusively. The tables below indicate how many line addresses each command allows.

Line addresses are always optional. The first line address of most commands usually defaults to the current line. The second line address usually defaults to be the same as the first line address. Exceptions are :write, :lpr, :global, and :vglobal, which act on all lines of the file by default, and :!, which acts on no lines by default.

If you use the visual V command to mark a range of lines, and then use the visual : command to execute a single ex command, then the default range affected by the ex command will be the visibly marked text.

Line addresses consist of an absolute part and a relative part. The absolute part of a line specifier may be either an explicit line number, a mark, a dot to denote the current line, a dollar sign to denote the last line of the file, or a forward or backward search. An explicit line number is simply a decimal number, expressed as a string of digits. A mark is typed in as an apostrophe followed by a letter. Marks must be set before they can be used. You can set a mark in visual command mode by typing "m" and a letter, or you can set it in ex command mode via the "mark" command. A forward search is typed in as a regular expression surrounded by slash characters; searching begins at the default line. A backward search is typed in as a regular expression surrounded by question marks; searching begins at the line before the default line.

If you omit the absolute part, then the default line is used.

The relative part of a line specifier is typed as a + or - character followed by a decimal number. The number is added to or subtracted from the absolute part of the line specifier to produce the final line number.

As a special case, the % character may be used to specify all lines of the file. It is roughly equivalent to saying 1,$. This can be a handy shortcut.

Here are some addressing examples, using the :p command:

   COMMAND      | ACTION
   -------------|-------------------------------------------
   :p           | print the current line
   :37p         | print line 37
   :'gp         | print the line which contains mark g
   :/foo/p      | print the next line that contains "foo"
   :$p          | print the last line of the buffer
   :20,30p      | print lines 20 through 30
   :1,$p        | print all lines of the buffer
   :%p          | print all lines of the buffer
   :(zot)%p     | print all lines of the "zot" buffer
   :/foo/-2,+4p | print 5 lines around the next "foo"

The optional addresses are followed by the command name. Command names may be abbreviated. In the sections that follow, the command's full name is given with the optional part enclosed in square brackets.

Some commands allow a '!' character to appear immediately after the command name. The significance of the '!' varies from one command to another, but typically it forces the command to do something dangerous that it would ordinarily refuse to do. For example, :w file refuses to overwrite an existing file, but :w! file will do it.

Many commands allow (or even require) additional arguments. The descriptions below list which arguments each command accepts with optional commands denoted by square brackets. The most common argument types are:

/regexp/
This is a regular expression. You can use any punctuation character to delimit it, but the '/' character is the most commonly used.

Note: When entering a tab character into a regular expression, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

/regexp/newtext/
This is a regular expression followed by replacement text.

Note: When entering a tab character into the replacement text, you should type (Ctrl-V)(Tab). Otherwise elvis will think the tab is intended to be used for file name expansion.

count
This is a number - a string of digits. Generally, it is used as the repeat count for certain commands.
cutbuf
This is the name of a cut buffer - a single letter. Elvis also allows (but does not require) a quote character before the letter.
excmds
This is another ex command, d by th value. A few other markups, described below, use the { ... } notation for their arguments.

This differs from TeX in two major ways:

\mathrelpunctuation
\charpunctuation
\punctuation
These output the punctuation character literally. In the real TeX, \mathrel is more subtle than that.
\title{text}
Display the text as a title: Centered, in the "bold" font.
\author{text}
Display the text as an author name: Centered, in the "italic" font.
\section{text}
Display the text as a section title: Starting at the leftmost column, in the "bold" font. Also, if it would be printed near the end of a page then it will be moved to the start of the next page instead.
\subsection{text}
Display the text as a subsection title: Indented slightly from the left edge, and in the "bold" font.
\hline
Draw a horizonal line across the page. Unfortunately, elvis' implementation tends to leave a blank line above the horizontal line.
\begin{table}
\hfil or \hfill or &
\cr or \\
\end{table}
These are used to present tables. \cr or \\ marks the end of each row, and \hfil, \hfill, or & mark the end of a column's data within a row. TeX actually offers other commands to control the shape of the table, but elvis doesn't support those commands.
\begin{quote}
\end{quote}
These are used to enclose a quoted paragraph. Elvis uses extra indentation while displaying the paragraph.
\begin{verbatim}
\end{verbatim}
These are used to enclose text which should be subjected to less processing; in particular, indentation and line breaks are preserved.
$$
A $$ pair toggles between the "normal" font with standard text filling, and the "fixed" font with lines displayed verbatim. This is typically used for presenting longer command-line examples on lines by themselves between paragraphs.
\begin{description}
\item[term]
\end{description}
This is used for presenting a series of terms followed by their definitions.
\begin{enumerate}
\item
\end{enumerate}
This is used for presenting a numbered list of items. Each item should be preceeded by \item.
\begin{itemize}
\item
\item[bullet]
\end{itemize}
This is used for presenting a list of items. Each item should be preceded either by \item to mark it with an asterisk, or by \item[bullet] to mark it with something other than an asterisk.
\tt
Switch to the "fixed" font. Generally, all of these font-switching commands will be used with { ... }, like this:
Normal text {\tt Fixed-font text} Normal again.
\bf
Switch to the "bold" font.
\em
\it
Switch to the "italic" font.
\fo
This is a common macro which indicates the following text is in a foreign language. Elvis supports it; it switches to the "italic" font.
$
A single $ character toggles between the "normal" font and the "fixed" font. This is often used for marking computer commands in the body of a paragraph.

7.7.2 Unsupported TeX markups

The following describes how elvis deals with certain unsupported features of TeX.
\vspace{value}
This is treated like a paragraph break.
\footnote{text}
The footnote is completely hidden, including its text.
\halign...
\begin{tabular}...
\multicolumn...
\set...
\def...
\new...
\catcode...
\document...
\other=...
Everything up to the end of the line is skipped. Other than that, the markup has no effect.
\other{text}
The markup and its text are ignored.
\other
Unrecognized markups are generally ignored. The single big exception is that if the markup is followed by punctuation or a backslash-space pair, then elvis assumes the markup is probably just an abbreviation for some word or phrase which is supposed to be displayed in a special font; so elvis displays the markup's name (without the leading backslash) in the "bold" font.
usr/doc/elvis/elvisex.html100644 0 0 251673 6502273123 14260 0ustar rootroot Elvis 2.1 Ex Mode

4. EX COMMAND MODE

Ex is an editing mode in which elvis acts like a line editor. This means that you type in a command line, and when the line is complete elvis executes it on the current text buffer. I.e., in ex each line (or group of lines) is a command, as opposed to vi where each character (or group of characters) is a command.

Typically, ex commands are used to do perform complex actions such as global search & replace, or actions which require an argument such as writing the edit buffer out to a different file.

Ex is also used as the configuration language for elvis; configuration scripts such as elvis.ini, .exrc (or elvis.rc), and elvis.arf contain a series of ex commands.

You can switch freely between vi and ex. If you're in vi mode, you can enter a single ex command line via the visual : command, or more permanently switch via the visual Q command. If you're in ex mode, you can switch to vi mode via ex's :vi command.

Normally elvis will start in vi mode, but you can force it to start in ex mode by supplying a -e command line flag. On UNIX systems, you can link elvis to a name which ends with "x" to achieve the same effect.

The remainder of this section discusses how to enter lines, the general syntax of an ex command line, and the specific commands which elvis supports.

4.1 Entering lines

In elvis, when you're typing in an ex command line you're really inputting text into a buffer named "Elvis ex history". All of the usual input mode commands are available, including Backspace to erase the previous character, Control-W to erase the previous word, and so on.

Any previously entered lines will still be in the "Elvis ex history" buffer, and you can use the arrow keys to move back and edit earlier commands. You can even use the Control-O input-mode command with the ?regexp visual command, to search for an earlier command line.

The Tab key has a special function when you're inputting text into the "Elvis ex history" buffer. It is used for file name expansion. The preceding word is assumed to be a partial file name, and elvis searches for all matching files. If there are multiple matches, then elvis fills in as many characters of the name as possible, and then beeps; or, if no additional characters are implied by the matching file names, then elvis lists all matching names and redisplays the command line. If there is a single match, then elvis completes the name and appends a tab character. If there are no matches, then elvis simply inserts a tab character.

You can bypass the file name expansion by typing a Control-V before the Tab key. You can also disable file name completion all together by setting the "Elvis ex history" buffer's inputtab option to "tab", via the following command:

	:(Elvis ex history)set inputtab=tab

When you hit the Enter key on a line in the "Elvis ex history" buffer, elvis sends that line to the ex command parser, which is described in the next section.

4.2 Syntax and Addressing

In general, ex command lines can begin with an optional window id. This may be followed by an optional buffer id, and then 0, 1, or 2 line addresses, followed by a command name, and perhaps some arguments after that (depending on the command name).

A window ID is typed in as a decimal number followed by a colon character. If you don't supply a window ID (and you almost never will) then it defaults to the window where you typed in the command line. The :buffer command lists the buffers, and shows which one is being edited in which window. Also, the windowid option indicates the ID of the current window.

A buffer ID is given by typing an opening parenthesis, the name of the buffer, and a closing parenthesis. For user buffers, the name of the buffer is usually identical to the name of the file that it corresponds to. For example, a file named ~/.Xdefaults would be loaded into a buffer which could be addressed as (~/.Xdefaults). Elvis also assigns numbers to user buffers, which may be more convenient to type since numbers are generally shorter than names. If ~/.Xdefaults is the first file you've edited since starting elvis, then its buffer could be addressed as (1). The :buffer command shows the number for each user buffer.

Elvis also has several internal buffers, all of which have names that start with "Elvis ", such as (Elvis cut buffer x) and (Elvis error list)<