SED - Cursor Movement Functions |
![]() ![]() ![]() |
Start line (Ctrl-A) Moves the cursor to the start of the current line (column 1).
End line (Ctrl-E) Moves the cursor to the position following the last character in the current line.
Top (Esc-<) Moves to the start of line 1.
Bottom (Esc- >) Moves to the start of the line immediately after the last line in the record.
Down line (Ctrl-N) Moves the cursor vertically down one line. If this position is beyond the end of the data in the new line, the cursor is displayed immediately to the right of the final character. The editor remembers the column position from which the cursor was moved so that a further vertical movement will continue to place the cursor at the lesser of its original column position and the end of the current line.
Up line (Ctrl-P or Ctrl-Z) Moves the cursor vertically up one line. The same process is used for determining the column position as for the down line operation described above.
Forward char (Ctrl-F) Moves the cursor right. Moving beyond the end of a line positions the cursor at the start of the following line.
Back char (Ctrl-B) Moves the cursor left. Moving beyond the start of a line positions the cursor at the end of the previous line.
Forward word (Esc-F) Moves the cursor to the first character after the next word. A word is defined as a continuous sequence of letters or digits.
Back word (Esc-B) Moves the cursor to the first character of the previous word. A word is defined as a continuous sequence of letters or digits.
Forward screen (Ctrl-V) Moves the cursor down by one screen or to the end of the buffer.
Back screen (Esc-V) Moves the cursor up by one screen or to the start of the buffer.
Goto line (Esc-G) Moves the cursor to the line number specified by the repeat counter. If no count has been entered, a prompt for the line number is issued.
Tab (Tab or Ctrl-I) Advances the cursor to the next horizontal tabulation position (columns 11, 21, 31, etc. by default. See the TABS command). If this is beyond the end of the data in the current line, spaces are inserted to extend the line to the required position. The tab function does not insert a tab character. Use the quote character prefix to do this.
Forward search (Ctrl-S or Esc-S) The forward search function prompts for a search string and advances to the next occurrence of this string within the record. The prompt defaults to the same string as the previous search function (if any). Searches may be performed in any of four modes:
The default search mode may changed during initialisation or by commands entered at the SED command prompt. Use of the up line and down line functions whilst entering the search string can also be used to change the mode except when collecting functions for a macro.
When a search is included in a macro, the prompt for the search string only occurs when collecting the macro. Subsequent executions use the same search string. Multiple search functions in a macro may have different search strings.
Reverse search (Ctrl-R or Esc-R) The reverse search function prompts for a search string and moves backwards to the previous occurrence of this string within the record. The prompt defaults to the same string as the previous search function (if any). Search modes are as described above.
Nudge down (Ctrl-X Ctrl-N) This function moves the displayed window down the record by one line. The cursor remains in the same position within the data unless it is on the top line of the screen in which case it will move down by one line.
Nudge up (Ctrl-X Ctrl-P or Ctrl-X Ctrl-Z) This function moves the displayed window up the record by one line. The cursor remains in the same position within the data unless it is on the last line of the screen in which case it will move up by one line.
Align text (Esc-tab) This function aligns the data on the current line to align text with the preceding line. |