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 -e
In 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 comman
TypeCTRL-B
%echo this is a ommand
TypeESC b
%cho this is a command
TypeCTRL-A
%
Get Using csh & tcsh now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.