[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17. Zsh Line Editor


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.1 Description

If the ZLE option is set (which it is by default in interactive shells) and the shell input is attached to the terminal, the user is able to edit command lines.

There are two display modes. The first, multiline mode, is the default. It only works if the TERM parameter is set to a valid terminal type that can move the cursor up. The second, single line mode, is used if TERM is invalid or incapable of moving the cursor up, or if the SINGLE_LINE_ZLE option is set. This mode is similar to ksh, and uses no termcap sequences. If TERM is "emacs", the ZLE option will be unset by default.

The parameters BAUD, COLUMNS, and LINES are also used by the line editor. 14.6 Parameters Used By The Shell.

17.2 Keymaps  
17.3 Zle Builtins  
17.4 Widgets  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.2 Keymaps

A keymap in ZLE contains a set of bindings between key sequences and ZLE commands. The empty key sequence cannot be bound.

There can be any number of keymaps at any time, and each keymap has one or more names. If all of a keymap's names are deleted, it disappears. bindkey can be used to manipulate keymap names.

Initially, there are four keymaps:

emacs
EMACS emulation
viins
vi emulation - insert mode
vicmd
vi emulation - command mode
.safe
fallback keymap

The `.safe' keymap is special. It can never be altered, and the name can never be removed. However, it can be linked to other names, which can be removed. In the future other special keymaps may be added; users should avoid using names beginning with `.' for their own keymaps.

In addition to these four names, either `emacs' or `viins' is also linked to the name `main'. If one of the VISUAL or EDITOR environment variables contain the string `vi' when the shell starts up then it will be `viins', otherwise it will be `emacs'. bindkey's -e and -v options provide a convenient way to override this default choice.

When the editor starts up, it will select the `main' keymap. If that keymap doesn't exist, it will use `.safe' instead.

In the `.safe' keymap, each single key is bound to self-insert, except for ^J (line feed) and ^M (return) which are bound to accept-line. This is deliberately not pleasant to use; if you are using it, it means you deleted the main keymap, and you should put it back.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.2.1 Reading Commands

When ZLE is reading a command from the terminal, it may read a sequence that is bound to some command and is also a prefix of a longer bound string. In this case ZLE will wait a certain time to see if more characters are typed, and if not (or they don't match any longer string) it will execute the binding. This timeout is defined by the KEYTIMEOUT parameter; its default is 0.4 sec. There is no timeout if the prefix string is not itself bound to a command.

As well as ZLE commands, key sequences can be bound to other strings, by using `bindkey -s'. When such a sequence is read, the replacement string is pushed back as input, and the command reading process starts again using these fake keystrokes. This input can itself invoke further replacement strings, but in order to detect loops the process will be stopped if there are twenty such replacements without a real command being read.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.3 Zle Builtins

The ZLE module contains three related builtin commands. The bindkey command manipulates keymaps and key bindings; the vared command invokes ZLE on the value of a shell parameter; and the zle command manipulates editing widgets and allows command line access to ZLE commands from within shell functions.

bindkey [ options ] -l
bindkey [ options ] -d
bindkey [ options ] -D keymap ...
bindkey [ options ] -A old-keymap new-keymap
bindkey [ options ] -N new-keymap [ old-keymap ]
bindkey [ options ] -m
bindkey [ options ] -r in-string ...
bindkey [ options ] -s in-string out-string ...
bindkey [ options ] in-string command ...
bindkey [ options ] [ in-string ]
bindkey's options can be divided into three categories: keymap selection, operation selection, and others. The keymap selection options are:

-e
Selects keymap `emacs', and also links it to `main'.

-v
Selects keymap `viins', and also links it to `main'.

-a
Selects keymap `vicmd'.

-M keymap
The keymap specifies a keymap name.

If a keymap selection is required and none of the options above are used, the `main' keymap is used. Some operations do not permit a keymap to be selected, namely:

-l
List all existing keymap names. If the -L option is also used, list in the form of bindkey commands to create the keymaps.

-d
Delete all existing keymaps and reset to the default state.

-D keymap ...
Delete the named keymaps.

-A old-keymap new-keymap
Make the new-keymap name an alias for old-keymap, so that both names refer to the same keymap. The names have equal standing; if either is deleted, the other remains. If there is already a keymap with the new-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that are unbound or bound to self-insert are affected.

-r in-string ...
Unbind the specified in-strings in the selected keymap. This is exactly equivalent to binding the strings to undefined-key.

When -R is also used, interpret the in-strings as ranges.

When -p is also used, the in-strings specify prefixes. Any binding that has the given in-string as a prefix, not including the binding for the in-string itself, if any, will be removed. For example,

 
bindkey -rpM viins '^['

will remove all bindings in the vi-insert keymap beginning with an escape character (probably cursor keys), but leave the binding for the escape character itself (probably vi-cmd-mode). This is incompatible with the option -R.

-s in-string out-string ...
Bind each in-string to each out-string. When in-string is typed, out-string will be pushed back and treated as input to the line editor. When -R is also used, interpret the in-strings as ranges.

in-string command ...
Bind each in-string to each command. When -R is used, interpret the in-strings as ranges.

[ in-string ]
List key bindings. If an in-string is specified, the binding of that string in the selected keymap is displayed. Otherwise, all key bindings in the selected keymap are displayed. (As a special case, if the -e or -v option is used alone, the keymap is not displayed - the implicit linking of keymaps is the only thing that happens.)

When the option -p is used, the in-string must be present. The listing shows all bindings which have the given key sequence as a prefix, not including any bindings for the key sequence itself.

When the -L option is used, the list is in the form of bindkey commands to create the key bindings.

When the -R option is used as noted above, a valid range consists of two characters, with an optional `-' between them. All characters between the two specified, inclusive, are bound as specified.

For either in-string or out-string, the following escape sequences are recognised:

\a
bell character
\b
backspace
\e, \E
escape
\f
form feed
\n
linefeed (newline)
\r
carriage return
\t
horizontal tab
\v
vertical tab
\NNN
character code in octal
\xNN
character code in hexadecimal
\M[-]X
character with meta bit set
\C[-]X
control character
^X
control character

In all other cases, `\' escapes the following character. Delete is written as `^?'. Note that `\M^?' and `^\M?' are not the same, and that (unlike emacs), the bindings `\M-X' and `\eX' are entirely distinct, although they are initialized to the same bindings by `bindkey -m'.

vared [ -Aache ] [ -p prompt ] [ -r rprompt ]
[ -M main-keymap ] [ -m vicmd-keymap ] name
The value of the parameter name is loaded into the edit buffer, and the line editor is invoked. When the editor exits, name is set to the string value returned by the editor. When the -c flag is given, the parameter is created if it doesn't already exist. The -a flag may be given with -c to create an array parameter, or the -A flag to create an associative array. If the type of an existing parameter does not match the type to be created, the parameter is unset and recreated.

If an array or array slice is being edited, separator characters as defined in $IFS will be shown quoted with a backslash, as will backslashes themselves. Conversely, when the edited text is split into an array, a backslash quotes an immediately following separator character or backslash; no other special handling of backslashes, or any handling of quotes, is performed.

Individual elements of existing array or associative array parameters may be edited by using subscript syntax on name. New elements are created automatically, even without -c.

If the -p flag is given, the following string will be taken as the prompt to display at the left. If the -r flag is given, the following string gives the prompt to display at the right. If the -h flag is specified, the history can be accessed from ZLE. If the -e flag is given, typing ^D (Control-D) on an empty line causes vared to exit immediately with a non-zero return value.

The -M option gives a keymap to link to the main keymap during editing, and the -m option gives a keymap to link to the vicmd keymap during editing. For vi-style editing, this allows a pair of keymaps to override viins and vicmd. For emacs-style editing, only -M is normally needed but the -m option may still be used. On exit, the previous keymaps will be restored.

zle
zle -l [ -L | -a ] [ string ... ]
zle -D widget ...
zle -A old-widget new-widget
zle -N widget [ function ]
zle -C widget completion-widget function
zle -R [ -c ] [ display-string ] [ string ... ]
zle -M string
zle -U string
zle -K keymap
zle -F [ -L ] [ fd [ handlodaliasnew-keymap name, it is deleted.

-N new-keymap [ old-keymap ]
Create a new keymap, named new-keymap. If a keymap already has that name, it is deleted. If an old-keymap name is given, the new keymap is initialized to be a duplicate of it, otherwise the new keymap will be empty.

To use a newly created keymap, it should be linked to main. Hence the sequence of commands to create and use a new keymap `mymap' initialized from the emacs keymap (which remains unchanged) is:

 
bindkey -N mymap emacs
bindkey -A mymap main

Note that while `bindkey -A newmap main' will work when newmap is emacs or viins, it will not work for vicmd, as switching from vi insert to command mode becomes impossible.

The following operations act on the `main' keymap if no keymap selection option was given:

-m
Add the built-in set of meta-key bindings to the selected keymap. Only keys that