Inserting lines of text

To insert one or more lines of new text into the edit buffer, use the i subcommand.

  1. You can specify the subcommand in one of two ways, depending on how you want to identify the line that the new lines are to be inserted before:
    • If you know the number of the line that you want to insert the new lines before, enter:
      ni
      where n is the number of that line.
    • To identify the line that the new lines are to be inserted before by words or a string of characters in the line (known as a regular expression), enter:
      /regexp/i
    where regexp is one or more words or a string of characters.
  2. Enter the new lines.
  3. End the insert by typing a . (period) on a line by itself.