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
key
to beup
,down
,left
, orright
, to indicate an arrow key.- –b
Allows
key
to beC-
X
orM-
X
, to indicateCTRL-
X
orMETA-
X
.- –a
Allows you to specify the alternate key map (the map used for vi command mode).
- ––
May be used immediately preceding
key
to tell bindkey to stop processing arguments as flags. This flag is useful whenkey
itself 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 -e
Select emacs bindings %bindkey -v
Select 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 ...
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.