Chapter 7. The tcsh Command-Line Editor

In This chapter:

  • Editing a Command

  • Command Key Bindings

  • emacs Editing Mode

  • vi Editing Mode

  • Examining and Modifying Key Bindings

tcsh provides a general purpose command-line editor. You can use it to retrieve and repeat commands from your history list (either as is or in modified form), or to modify the current command. For instance, if you notice a typo at the beginning of the line, you can move the cursor to the beginning and correct the mistake, instead of erasing the command and retyping it.

The command editor is extremely useful, but it can be daunting initially. When you first try it, don’t attempt to learn everything at once. Instead of trying to commit dozens of editing commands to memory in a single session, start with a few. Once you’re comfortable, learn a few more. Take it slow, but stick with it—using the editor becomes increasingly natural with practice, and you’ll be glad you took the time to learn it.

This chapter is organized into the following sections:

  • An overview of the editing process

  • How to choose a set of bindings and ensure that you get the right set at login time

  • How to edit commands using the emacs or vi bindings

  • How to get information about or change your current bindings

Editing a Command

You can use the editor to make arbitrarily complex changes to a command, but the editing process is conceptually quite simple. Type in a new command (or retrieve a command from your history list); if it needs modification (e.g., to create a similar ...

Get Using csh & tcsh now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.