O'Reilly logo

Learning the Korn Shell, 2nd Edition by Bill Rosenblatt, Arnold Robbins

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

If you are an Emacs user, you will find it most useful to think of emacs editing mode as a simplified Emacs with a single, one-line window. All of the basic commands are available for cursor motion, cut and paste, and search.

Basic Commands

Emacs-mode uses control keys for the most basic editing functions. If you aren’t familiar with Emacs, you can think of these as extensions of the rudimentary “erase” character (usually backspace or DEL) that Unix provides through its interface to users’ terminals. In fact, emacs-mode figures out what your erase character is and uses that as its delete-backward key. For the sake of consistency, we’ll assume your erase character is DEL from now on; if it is CTRL-H or something else, you will need to make a mental substitution. The most basic control-key commands are shown in Table 2-1.

Table 2-1. Basic emacs-mode commands

CommandDescription
CTRL-BMove backward one character (without deleting)
CTRL-FMove forward one character
DELDelete one character backward
CTRL-DDelete one character forward
CTRL-YRetrieve (“yank”) last item deleted

Warning

Remember that typing CTRL-D when your command line is empty may log you off!

The basic finger habits of emacs-mode are easy to learn, but they do require that you assimilate a couple of concepts that are peculiar to the Emacs editor.

The first of these is the use of CTRL-B and CTRL-F for backward and forward cursor motion. These keys have the advantage of being obvious mnemonics, ...

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