readline keymap == emacs || emacs-standard || emacs-meta || emacs-ctlx
I see in the man page for bash there are different keymap options for the readline editing-mode. What I don't see is any documentation on the various modes. ############## from man bind ##################### bind readline-command ... -m keymap Use keymap as the keymap to be affected by the subsequent bindings. Acceptable keymap names are emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, and vi-insert. vi is equivalent to vi-command; emacs is equivalent to emacs-standard. ################# end ########################### I'm going to play with this a bit to see if I can't figure it out, but it's not even clear how to set the keymap, or any other of these options, for that matter. If I do `help bind', I see: ############## output ##################### bind: bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command] Bind a key sequence to a Readline function or a macro, or set a Readline variable. The non-option argument syntax is equivalent to that found in ~/.inputrc, but must be passed as a single argument: bind '"\C-x\C-r": re-read-init-file'. bind accepts the following options: -m keymap Use `keymap' as the keymap for the duration of this command. Acceptable keymap names are emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move, vi-command, and vi-insert. -l List names of functions. -P List function names and bindings. -p List functions and bindings in a form that can be reused as input. -r keyseq Remove the binding for KEYSEQ. -x keyseq:shell-command Cause SHELL-COMMAND to be executed when KEYSEQ is entered. -f filename Read key bindings from FILENAME. -q function-name Query about which keys invoke the named function. -u function-name Unbind all keys which are bound to the named function. -V List variable names and values -v List variable names and values in a form that can be reused as input. -S List key sequences that invoke macros and their values -s List key sequences that invoke macros and their values in a form that can be reused as input. ################# end ########################### `bind -v' results in: ################ output ###################### set blink-matching-paren on set byte-oriented off set completion-ignore-case off set convert-meta off set disable-completion off set enable-keypad off set expand-tilde off set history-preserve-point off set horizontal-scroll-mode off set input-meta on set mark-directories on set mark-modified-lines off set mark-symlinked-directories off set match-hidden-files on set meta-flag on set output-meta on set page-completions on set prefer-visible-bell on set print-completions-horizontally off set show-all-if-ambiguous off set visible-stats off set bell-style audible set comment-begin # set completion-query-items 100 set editing-mode emacs set keymap emacs ################ end ###################### But `set keymap emacs-meta' does not change the result of the previous command. Is there a good resource on these bash/readline related issues? STH
On Thu, 29 Jan 2004 12:01, Steven T. Hatton wrote:
I see in the man page for bash there are different keymap options for the readline editing-mode. What I don't see is any documentation on the various modes.
There are two modes - VI and emacs - emacs is the default. In the O'Riellly book on "Learning the Bash Shell" there are about 30 pages covering command line editing. Try the following command for a list of keys and their bindings bind -P 'bind -l' will give you a list of readline functions. 'bind -p' will give you a list in the format for .inputrc so you can do:- bind -p > .inputrc Hope that helps. This is only the tip of the iceburg on command line editing and the rest can't really be covered in an email. -- Regards, Graham Smith ---------------------------------------------------------
participants (2)
-
Graham Smith
-
Steven T. Hatton