emacs Editing Mode
This section describes how to edit commands using the emacs bindings. Be sure to select those bindings before trying any of the commands described below:
% bindkey -eIn emacs mode, editing commands are always active. Any character that is not an editing command is inserted into the edit buffer. Otherwise, the command is executed.
emacs Cursor Motion Commands
Before making a change (e.g., adding or deleting text), you position the cursor. The emacs cursor motion commands are shown in Table 7-1.
Table 7-1. Cursor Positioning Commands (emacs Mode)
Command | Description |
|---|---|
| Move cursor back (left) one character |
| Move cursor forward (right) one character |
| Move cursor back one word |
| Move cursor forward one word |
| Move cursor to beginning of line |
| Move cursor to end of line |
Try these commands by entering the following line, leaving the cursor at the end:
% echo this is a command
Then, enter the editing commands below; you should see the cursor move, as shown:
%echo this is a commanTypeCTRL-B%echo this is aTypeommand
ESC b%Typecho this is a command
CTRL-A%
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access