O'Reilly logo

Using csh & tcsh by Paul DuBois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

CTRL-B

Move cursor back (left) one character

CTRL-F

Move cursor forward (right) one character

ESC b

Move cursor back one word

ESC f

Move cursor forward one word

CTRL-A

Move cursor to beginning of line

CTRL-E

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       Type CTRL-B
% echo this is a ommand       Type ESC b
% cho this is a command       Type CTRL-A
% 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required