Examining and Modifying Key Bindings
tcsh lets you display and change your key bindings using the bindkey command. The various forms of bindkey are summarized in Table 7-9, and discussed below.
Table 7-9. Forms of the bindkey Command
Command | Description |
|---|---|
| Select emacs bindings |
| Select vi bindings |
| Restore default bindings |
| Display bindkey usage message |
| List editing commands and their meanings |
| List all key bindings |
| List binding for |
| Bind |
| Bind |
| Bind |
| Remove binding for |
The forms of bindkey that take a key argument also allow the following flags:
- –k
Allows
keyto beup,down,left, orright, to indicate an arrow key.- –b
Allows
keyto beC-XorM-X, to indicateCTRL-XorMETA-X.- –a
Allows you to specify the alternate key map (the map used for vi command mode).
- ––
May be used immediately preceding
keyto tell bindkey to stop processing arguments as flags. This flag is useful whenkeyitself begins with a dash.
–k and -b cannot both be used in the same command.
Selecting a Set of Bindings
To select a set of bindings en masse, use the -e or -v option:
%bindkey -eSelect emacs bindings %bindkey -vSelect vi bindings
Selecting either set rebinds every key to the default for that set, undoing any prior bindings you may have established. To bind any individual keys specially (as discussed under Changing Key Bindings ...
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