diff options
author | Kevin Ballard <kevin@sb.org> | 2014-09-22 21:30:44 -0700 |
---|---|---|
committer | Kevin Ballard <kevin@sb.org> | 2014-09-22 21:30:44 -0700 |
commit | 5b33e6075283a4f0def2c87ccf789da824980f8a (patch) | |
tree | cfabe544ca416ef4f7f20260fe81dc78772aada3 /doc_src | |
parent | 80078491bd1f3555051a64da6ec0daa397792f76 (diff) |
Support `bind SEQ` to print a binding for `SEQ`
Diffstat (limited to 'doc_src')
-rw-r--r-- | doc_src/bind.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc_src/bind.txt b/doc_src/bind.txt index 93e1f80d..599a1ec3 100644 --- a/doc_src/bind.txt +++ b/doc_src/bind.txt @@ -4,6 +4,7 @@ \fish{synopsis} bind [(-M | --mode) MODE] [(-m | --sets-mode) NEW_MODE] [(-k | --key)] SEQUENCE COMMAND [COMMAND...] +bind [(-M | --mode) MODE] [(-k | --key)] SEQUENCE bind (-K | --key-names) [(-a | --all)] bind (-f | --function-names) bind (-e | --erase) [(-M | --mode) MODE] @@ -12,8 +13,7 @@ bind (-e | --erase) [(-M | --mode) MODE] \subsection bind-description Description -`bind` adds a binding for the specified key sequence to the -specified command. +`bind` adds a binding for the specified key sequence to the specified command. SEQUENCE is the character sequence to bind to. These should be written as <a href="index.html#escapes">fish escape sequences</a>. For example, because pressing the Alt key and another character sends that character prefixed with an escape character, Alt-based key bindings can be written using the `\e` escape. For example, @key{Alt,w} can be written as `\ew`. The control character can be written in much the same way using the `\c` escape, for example @key{Control,X} (^X) can be written as `\cx`. Note that Alt-based key bindings are case sensitive and Control-based key bindings are not. This is a constraint of text-based terminals, not `fish`. @@ -27,6 +27,10 @@ When `COMMAND` is a shellscript command, it is a good practice to put the actual If such a script produces output, the script needs to finish by calling `commandline -f repaint` in order to tell fish that a repaint is in order. +When multiple `COMMAND`s are provided, they are all run in the specified order when the key is pressed. + +If no `SEQUENCE` is provided, all bindings (or just the bindings in the specified `MODE`) are printed. If `SEQUENCE` is provided without `COMMAND`, just the binding matching that sequence is printed. + Key bindings are not saved between sessions by default. To save custom keybindings, edit the `fish_user_key_bindings` function and insert the appropriate `bind` statements. Key bindings may use "modes", which mimics Vi's modal input behavior. The default mode is "default", and every bind applies to a single mode. The mode can be viewed/changed with the `$fish_bind_mode` variable. |