The bindkey built-in prints or modifies key bindings used in line-editing.

Syntax

  • bindkey -aev [key [command]]

  • bindkey -l

Description

When executed with the -l (--list) option, the built-in lists all available line-editing commands to the standard output.

When executed with one of the other options, the built-in prints or modifies key bindings for the editing mode specified by the option:

  • Without key or command, all currently defined bindings are printed to the standard output in a form that can be parsed as commands that restore the current bindings when executed.

  • With key but without command, only the binding for the given key is printed.

  • With key and command, key is bound to command.

Options

-a
--vi-command

Print or modify bindings for the vi command mode.

-e
--emacs

Print or modify bindings for the emacs mode.

-v
--vi-insert

Print or modify bindings for the vi insert mode.

Operands

key

A character sequence of one or more keys that is bound to an editing command. The sequence may include escape sequences.

command

A line-editing command to which key is bound. If command is a single hyphen (-), key is unbound.

Exit status

The exit status of the bindkey built-in is zero unless there is any error.

Notes

The bindkey built-in is an elective built-in. It cannot be used in the POSIXly-correct mode because POSIX does not define its behavior.