docs: Use more command labels

This commit is contained in:
Fabian Homborg 2019-03-31 11:24:04 +02:00
parent cb94dd4d30
commit 86d4574222
9 changed files with 10 additions and 10 deletions

View file

@ -26,7 +26,7 @@ Description
SEQUENCE is the character sequence to bind to. These should be written as `fish escape sequences <index.html#escapes>`__. 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, :kbd:`Alt+w` can be written as ``\ew``. The control character can be written in much the same way using the ``\c`` escape, for example :kbd:`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.
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.) If used in conjunction with the ``-s`` switch, ``bind`` will silently ignore bindings to named keys that are not found in termcap for the current ``$TERMINAL``, otherwise a warning is emitted.

View file

@ -12,7 +12,7 @@ LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end
Description
-----------
``continue`` skips the remainder of the current iteration of the current inner loop, such as a <a href="#for">for</a> loop or a <a href="#while">while</a> loop. It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement.
``continue`` skips the remainder of the current iteration of the current inner loop, such as a :ref:`for <cmd-for>` loop or a :ref:`while <cmd-while>` loop. It is usually added inside of a conditional block such as an :ref:`if <cmd-if>` statement or a :ref:`switch <cmd-switch>` statement.
Example
-------

View file

@ -13,7 +13,7 @@ dirs -c
Description
-----------
``dirs`` prints the current directory stack, as created by the <a href="#pushd">``pushd``</a> command.
``dirs`` prints the current directory stack, as created by the :ref:`pushd <cmd-pushd>` command.
With "-c", it clears the directory stack instead.

View file

@ -17,7 +17,7 @@ Description
``if`` will execute the command ``CONDITION``. If the condition's exit status is 0, the commands ``COMMANDS_TRUE`` will execute. If the exit status is not 0 and ``else`` is given, ``COMMANDS_FALSE`` will be executed.
You can use <a href="#and">``and``</a> or <a href="#or">``or``</a> in the condition. See the second example below.
You can use :ref:`and <cmd-and>` or :ref:`or <cmd-or>` in the condition. See the second example below.
The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.

View file

@ -14,8 +14,8 @@ Description
``or`` is used to execute a command if the previous command was not successful (returned a status of something other than 0).
``or`` statements may be used as part of the condition in an <a href="#if">``and``</a> or <a href="#while">``while``</a> block. See the documentation
for <a href="#if">``if``</a> and <a href="#while">``while``</a> for examples.
``or`` statements may be used as part of the condition in an :ref:`and <cmd-if>` or :ref:`while <cmd-while>` block. See the documentation
for :ref:`if <cmd-if>` and :ref:`while <cmd-while>` for examples.
``or`` does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the <a href="index.html#variables-status">$status</a> variable.

View file

@ -12,7 +12,7 @@ popd
Description
-----------
``popd`` removes the top directory from the directory stack and changes the working directory to the new top directory. Use <a href="#pushd">``pushd``</a> to add directories to the stack.
``popd`` removes the top directory from the directory stack and changes the working directory to the new top directory. Use :ref:`pushd <cmd-pushd>` to add directories to the stack.
You may be interested in the <a href="commands.html#cdh">``cdh``</a> command which provides a more intuitive way to navigate to recently visited directories.

View file

@ -12,7 +12,7 @@ pushd [DIRECTORY]
Description
-----------
The ``pushd`` function adds ``DIRECTORY`` to the top of the directory stack and makes it the current working directory. <a href="#popd">``popd``</a> will pop it off and return to the original directory.
The ``pushd`` function adds ``DIRECTORY`` to the top of the directory stack and makes it the current working directory. :ref:`popd <cmd-popd>` will pop it off and return to the original directory.
Without arguments, it exchanges the top two directories in the stack.

View file

@ -14,7 +14,7 @@ Description
``return`` halts a currently running function. The exit status is set to ``STATUS`` if it is given.
It is usually added inside of a conditional block such as an <a href="#if">if</a> statement or a <a href="#switch">switch</a> statement to conditionally stop the executing function and return to the caller, but it can also be used to specify the exit status of a function.
It is usually added inside of a conditional block such as an :ref:`if <cmd-if>` statement or a :ref:`switch <cmd-switch>` statement to conditionally stop the executing function and return to the caller, but it can also be used to specify the exit status of a function.
Example

View file

@ -16,7 +16,7 @@ Description
The exit status of the while loop is the exit status of the last iteration of the ``COMMANDS`` executed, or 0 if none were executed. (This matches other shells and is POSIX-compatible.)
You can use <a href="#and">``and``</a> or <a href="#or">``or``</a> for complex conditions. Even more complex control can be achieved with ``while true`` containing a <a href="#break">break</a>.
You can use :ref:`and <cmd-and>` or :ref:`or <cmd-or>` for complex conditions. Even more complex control can be achieved with ``while true`` containing a :ref:`break <cmd-break>`.
Example
-------