From cf8e746d0c04aec16df8e69d2987c785cb510d46 Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Wed, 26 Sep 2007 02:14:47 +1000 Subject: First stab at dropping all support for readlines inputrc files and instead using an internal system for performing keybinding. darcs-hash:20070925161447-75c98-1feaef88a4b518badb7879f598f06ab650a8f93b.gz --- doc_src/bind.txt | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'doc_src/bind.txt') diff --git a/doc_src/bind.txt b/doc_src/bind.txt index 13f22f38..e899b0bd 100644 --- a/doc_src/bind.txt +++ b/doc_src/bind.txt @@ -1,23 +1,43 @@ -\section bind bind - handle key bindings +\section bind bind - handle fish key bindings \subsection bind-synopsis Synopsis -bind [OPTIONS] [BINDINGS...] +bind [OPTIONS] SEQUENCE COMMAND -The bind builtin causes fish to add the readline style bindings specified by BINDINGS to the list of key bindings, as if they appeared in your ~/.fish_inputrc file. +\subsection bind-description Description -For more information on the syntax keyboard bindings, use man -readline to access the readline documentation. The available commands -are listed in the Command Line Editor section -of the fish manual - but you may also use any fish command! To write such -commands, see the commandline builtin. It's good -practice to put the code into a function -b -and bind to the function name. +The bind builtin causes fish to add a key binding from the specified sequence. + +SEQUENCE is the character sequence to bind to. Usually, one would use +fish escape sequences to express them. For example, Alt-w can be +written as \\ew, and Control-x can be written as +\\cx. + +If the -k switch is used, the name of the key (such as down, up or +backspace) is used instead of a sequence. The names used are the same +as the corresponding curses variables, but without the 'key_' +prefix. (See man 5 terminfo for more information, or use bind +--names for a list of all available named keys) + +COMMAND can be any fish command, but it can also be one of a set of +special input functions. These include functions for moving the +cursor, operating on the kill-ring, performing tab completion, +etc. Use 'bind -N' for a complete list of these input functions. + +When COMMAND is a shellscript command, it is a good practice to put +the actual code into a function and simply +bind to the function name. + +- -a or --all If --print-key-names is specified, show all key names, not only the ones that actually are defined for the current terminal. If erase mode is specified, this switch will cause all current bindings to be erased. +- -e or --erase Erase mode. All non-switch arguments are interpreted as character sequences and any commands associated with those sequences are erased. +- -h or --help Display help and exit +- -k or --key Specify a key name, such as 'left' or 'backspace' instead of a character sequence +- -K or --key-names Display a list of available key names +- -f or --function-names Display a list of available input functions -\subsection bind-description Description -- -M MODE or --set-mode=MODE sets the current input mode to MODE. \subsection bind-example Example -bind -M vi changes to the vi input mode +bind \cd 'exit' causes fish to exit on Control-d + +bind -k ppage history-search-backward Causes fish to perform a history search when the page up key is pressed -bind '"\\M-j": jobs' Binds the jobs command to the Alt-j keyboard shortcut -- cgit v1.2.3