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.
- 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:
===== Tom, Tom, the piper's son, Stole a pig and away he run. ↑ │ └─── cursor
Tom, Tom, the piper's son, Stole a pig and away he run.
Press PF11. Now you have two lines:
===== Tom, Tom, the piper's son, _ <========== cursor ===== Stole a pig and away he run.
Tom, Tom, the piper's son,
Stole a pig and away he run.
The cursor remains where it was before the line was split.
===== Tom, Tom, the piper's son, hopped a rig, did a jig,
===== Stole a pig and away he run.
- 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.)
===== The pig got loose _ <===== cursor ===== and scared a goose,
The pig got loose
and scared a goose,
The result is:
===== The pig got loose and scared a goose,
====> file