Splitting and Joining Lines

To split or join lines, you can press a PF key instead of typing a command in the command line and then pressing Enter. There is nothing magical about PF keys. During an editing session, each one is set to an XEDIT command. (When you are not editing a file, the PF keys are set to different functions, but we will talk more about this later.) You do not press Enter when you use PF keys. The command is sent to the editor automatically when you press the PF key.

Important Note: In this document, we will be talking about PF keys 1 through 12. If your terminal has 24 PF keys, PF keys 13 to 24 are used like PF keys 1 to 12 as discussed here.

To split a line in two:
  • Move the cursor under the character where you want the line to be split.
  • Press PF11.

Let us split the first line in this file. Use the cursor movement keys to place the cursor under the S in Stole, like this:

Skip over ASCII art.

===== Tom, Tom, the piper's son, Stole a pig and away he run.
                                 ↑
                                 │
                                 └─── cursor
The figure shows the following line:
Tom, Tom, the piper's son, Stole a pig and away he run.

Press PF11. Now you have two lines:

Skip over ASCII art.

===== Tom, Tom, the piper's son, _  <========== cursor
===== Stole a pig and away he run.
The figure shows the following lines:
Tom, Tom, the piper's son,
Stole a pig and away he run.

The cursor remains where it was before the line was split.

You may want to split a line if you need to add information to a line. The cursor is in place, and you can continue typing on that line. For example:
===== Tom, Tom, the piper's son, hopped a rig, did a jig,
===== Stole a pig and away he run.
To join two short lines:
  • Place the cursor at the end of the first line.
  • Press PF11.

For example, to join the following two lines, place the cursor as shown, and press PF11. (Make sure you leave one space between loose and the cursor.)

Skip over ASCII art.

===== The pig got loose _ <===== cursor
===== and scared a goose,
The figure shows the following lines:
The pig got loose
and scared a goose,

The result is:

===== The pig got loose and scared a goose,
Now, move the cursor to the command line and enter the command to file your work:
====> file