In the man
page for .editrc
a command is shown for listing key bindings for editline. Editline is a library that is used in Python and MySQL, etc., in MacOS for command line editing.
bind
or
bind -l
I can enter one of these commands in my ~/.editrc
and start an application such as Python which is bound to the editline library and get the output. However there is no indication how to obtain the list interactively from the command line.
Issuing a bind
command from zsh
gives a command not found error. Zsh uses its own key bindings and has a bindkey
command. Bash uses readline and has a bind
command but that's a builtin that's specific to Bash and readline.
How can I output the list without adding the command to .editrc
?
~/.editrc
on macOS. As this is only used by 3rd party binaries like Python or MySQL there is no macOS man page for this./usr/share/man/man5/editrc.5
which I presume was part of the base install provided by Apple. I used the link in my answer because I couldn't find a link to an Apple-provided online page for it. Perhaps I should have used the FreeBSD one but it's incomplete. Here's a neutral one that's complete.bind
can only be used in~/.editrc
:The format of each line is: [prog:]command [arg [...]]
,command is one of the editline(3) builtin commands
, andbind
is listed as one of them.stdout
. Thehistory
command also does it.