5.  Command structure

      Most command names are English words, and initial prefixes of the words are acceptable abbreviations. The ambiguity of abbreviations is resolved in favor of the more commonly used commands.*

5.1.  Command parameters

      Most commands accept prefix addresses specifying the lines in the file upon which they are to have effect. The forms of these addresses will be discussed below. A number of commands also may take a trailing count specifying the number of lines to be involved in the command.** Thus the command ``10p'' will print the tenth line in the buffer while ``delete 5'' will delete five lines from the buffer, starting with the current line.

      Some commands take other information or parameters, this information always being given after the command name.***

5.2.  Command variants

      A number of commands have two distinct variants. The variant form of the command is invoked by placing an `!' immediately after the command name. Some of the default variants may be controlled by options; in this case, the `!' serves to toggle the default.

5.3.  Flags after commands

      The characters `#', `p' and `l' may be placed after many commands.** In this case, the command abbreviated by these characters is executed after the command completes. Since ex normally prints the new current line after each change, `p' is rarely necessary. Any number of `+' or `-' characters may also be given with these flags. If they appear, the specified offset is applied to the current line value before the printing command is executed.

5.4.  Comments

      It is possible to give editor commands which are ignored. This is useful when making complex editor scripts for which comments are desired. The comment character is the double quote: ". Any command line beginning with " is ignored. Comments beginning with " may also be placed at the ends of commands, except in cases where they could be confused as part of text (shell escapes and the substitute and map commands).

5.5.  Multiple commands per line

      More than one command may be placed on a line by separating each pair of commands by a `|' character. However the global commands, comments, and the shell escape `!' must be the last command on a line, as they are not terminated by a `|'.

5.6.  Reporting large changes

      Most commands which change the contents of the editor buffer give feedback if the scope of the change exceeds a threshold given by the report option. This feedback helps to detect undesirably large changes so that they may be quickly and easily reversed with an undo. After commands with more global effect such as global or visual, you will be informed if the net change in the number of lines in the buffer during this command exceeds this threshold.