aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/bind.txt
diff options
context:
space:
mode:
authorGravatar Mark Griffiths <mark@thebespokepixel.com>2014-08-01 03:37:32 +0100
committerGravatar Mark Griffiths <mark@thebespokepixel.com>2014-09-03 14:43:24 +0100
commitd282bc462578a6e47747c78d2d42883530f0d11e (patch)
treea6515e908d4fc1c400cb6cebaf79b1590b005804 /doc_src/bind.txt
parent1c4223889bd729ee83aa21a3450dc28f92ade641 (diff)
Documentation update
Rework for Doxygen >1.8. Moved large parts of the documentation to a simplified format, making use of Markdown enhancements and fixing bad long options.
Diffstat (limited to 'doc_src/bind.txt')
-rw-r--r--doc_src/bind.txt149
1 files changed, 73 insertions, 76 deletions
diff --git a/doc_src/bind.txt b/doc_src/bind.txt
index 8c7004d0..442d7e99 100644
--- a/doc_src/bind.txt
+++ b/doc_src/bind.txt
@@ -1,97 +1,94 @@
\section bind bind - handle fish key bindings
\subsection bind-synopsis Synopsis
-<tt>bind [OPTIONS] SEQUENCE COMMAND</tt>
+\fish{syn}
+bind [OPTIONS] SEQUENCE COMMAND
+\endfish
\subsection bind-description Description
-<tt>bind</tt> adds a binding for the specified key sequence to the
+`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
-\c \\e escape. For example, Alt-w can be written as
-<tt>\\ew</tt>. The control character can be written in much the same way
-using the \c \\c escape, for example Control-x (^X) can be written as
-<tt>\\cx</tt>. 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 \c fish.
-
-The default key binding can be set by specifying a SEQUENCE of the empty
-string (that is, <code>''</code>). It will be used whenever no
-other binding matches. For most key bindings, it makes sense to use
-the \c self-insert function (i.e. <tt>bind '' self-insert</tt> as the
-default keybinding. This will insert any keystrokes not specifically
-bound to into the editor. Non-printable characters are ignored by the
-editor, so this will not result in control sequences being
-printable.
-
-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 \c terminfo(5) for more information, or use <tt>bind
---key-names</tt> 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 --function-names' 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 <a href="#function">function</a> and simply
-bind to the function name. This way it becomes significantly easier to
-test the function while editing, and the result is usually more
-readable as well.
-
-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.
+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`.
+
+The default key binding can be set by specifying a `SEQUENCE` of the empty
+string (that is, ```''``` ). It will be used whenever no other binding
+matches. For most key bindings, it makes sense to use the `self-insert`
+function (i.e. ```bind '' self-insert```) as the default keybinding. This
+will insert any keystrokes not specifically bound to into the editor. Non-
+printable characters are ignored by the editor, so this will not result in
+control sequences being printable.
+
+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
+`terminfo(5)` for more information, or use `bind --key-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 --function-names` 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 <a href="#function">function</a> and simply bind to the function
+name. This way it becomes significantly easier to test the function while
+editing, and the result is usually more readable as well.
+
+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.
Key bindings are not saved between sessions by default. To save custom
-keybindings, edit the \c fish_user_key_bindings function and insert the
-appropriate \c bind statements.
+keybindings, edit the `fish_user_key_bindings` function and insert the
+appropriate `bind` statements.
The following parameters are available:
-- <tt>-k</tt> or <tt>--key</tt> Specify a key name, such as 'left' or 'backspace' instead of a character sequence
-- <tt>-K</tt> or <tt>--key-names</tt> Display a list of available key names
-- <tt>-f</tt> or <tt>--function-names</tt> Display a list of available input functions
+- `-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
The following special input functions are available:
-- \c backward-char, moves one character to the left
-- \c backward-delete-char, deletes one character of input to the left of the cursor
-- \c backward-kill-line, move everything from the beginning of the line to the cursor to the killring
-- \c backward-kill-word, move the word to the left of the cursor to the killring
-- \c backward-word, move one word to the left
-- \c beginning-of-history, move to the beginning of the history
-- \c beginning-of-line, move to the beginning of the line
-- \c capitalize-word, make the current word begin with a capital letter
-- \c complete, guess the remainder of the current token
-- \c delete-char, delete one character to the right of the cursor
-- \c delete-line, delete the entire line
-- \c downcase-word, make the current word lowercase
-- \c dump-functions, print a list of all key-bindings
-- \c end-of-history, move to the end of the history
-- \c end-of-line, move to the end of the line
-- \c explain, print a description of possible problems with the current command
-- \c forward-char, move one character to the right
-- \c forward-word, move one word to the right
-- \c history-search-backward, search the history for the previous match
-- \c history-search-forward, search the history for the next match
-- \c kill-line, move everything from the cursor to the end of the line to the killring
-- \c kill-whole-line, move the line to the killring
-- \c kill-word, move the next word to the killring
-- \c upcase-word, make the current word uppercase
-- \c yank, insert the latest entry of the killring into the buffer
-- \c yank-pop, rotate to the previous entry of the killring
+- `backward-char`, moves one character to the left
+- `backward-delete-char`, deletes one character of input to the left of the cursor
+- `backward-kill-line`, move everything from the beginning of the line to the cursor to the killring
+- `backward-kill-word`, move the word to the left of the cursor to the killring
+- `backward-word`, move one word to the left
+- `beginning-of-history`, move to the beginning of the history
+- `beginning-of-line`, move to the beginning of the line
+- `capitalize-word`, make the current word begin with a capital letter
+- `complete`, guess the remainder of the current token
+- `delete-char`, delete one character to the right of the cursor
+- `delete-line`, delete the entire line
+- `downcase-word`, make the current word lowercase
+- `dump-functions`, print a list of all key-bindings
+- `end-of-history`, move to the end of the history
+- `end-of-line`, move to the end of the line
+- `explain`, print a description of possible problems with the current command
+- `forward-char`, move one character to the right
+- `forward-word`, move one word to the right
+- `history-search-backward`, search the history for the previous match
+- `history-search-forward`, search the history for the next match
+- `kill-line`, move everything from the cursor to the end of the line to the killring
+- `kill-whole-line`, move the line to the killring
+- `kill-word`, move the next word to the killring
+- `upcase-word`, make the current word uppercase
+- `yank`, insert the latest entry of the killring into the buffer
+- `yank-pop`, rotate to the previous entry of the killring
\subsection bind-example Examples
-<tt>bind \\cd 'exit'</tt> causes \c fish to exit when Control-d is pressed.
+`bind \cd 'exit'` causes `fish` to exit when @key{Control,D} is pressed.
-<tt>bind -k ppage history-search-backward</tt> performs a history search when the Page Up key is pressed.
+`bind -k ppage history-search-backward` performs a history search when the @key{Page Up} key is pressed.