mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-27 20:25:12 +00:00
docs: Remove explicit .html links
Instead, we link to rst labels, which could also work in non-html output, or if the section ever moves elsewhere. See #5696. [ci skip]
This commit is contained in:
parent
1377f71331
commit
17116366dc
3 changed files with 12 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
.. highlight:: fish-docs-samples
|
||||
.. _commands:
|
||||
|
||||
Commands
|
||||
============
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.. _design:
|
||||
|
||||
Design
|
||||
======
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Shell Standards
|
|||
|
||||
A shell is an interface to the operating system that reads from the commandline of a terminal. A shell's task is to identify and interpret commands. The commands can come from different applications and can be written in different programming languages.
|
||||
|
||||
This can only work smoothly if shells adapt to some common standards. For shells there is the POSIX standard, see `Command-line interpreters <https://en.wikipedia.org/wiki/Command-line_interface#Command-line_interpreter>`_. ``fish`` tries to satisfy the POSIX standard wherever it does not get into the way of its own design principles, see `Design <design.html>`_.
|
||||
This can only work smoothly if shells adapt to some common standards. For shells there is the POSIX standard, see `Command-line interpreters <https://en.wikipedia.org/wiki/Command-line_interface#Command-line_interpreter>`_. ``fish`` tries to satisfy the POSIX standard wherever it does not get into the way of its own design principles, see :ref:`Design <Design>`.
|
||||
|
||||
Manual Pages
|
||||
------------
|
||||
|
@ -439,7 +439,7 @@ For example, the following is a function definition that calls the command ``ls`
|
|||
ls -l $argv
|
||||
end
|
||||
|
||||
The first line tells fish that a function by the name of ``ll`` is to be defined. To use it, simply write ``ll`` on the commandline. The second line tells fish that the command ``ls -l $argv`` should be called when ``ll`` is invoked. '``$argv``' is an array variable, which always contains all arguments sent to the function. In the example above, these are simply passed on to the ``ls`` command. For more information on functions, see the documentation for the `function <cmds/function.html>`_ builtin.
|
||||
The first line tells fish that a function by the name of ``ll`` is to be defined. To use it, simply write ``ll`` on the commandline. The second line tells fish that the command ``ls -l $argv`` should be called when ``ll`` is invoked. '``$argv``' is an array variable, which always contains all arguments sent to the function. In the example above, these are simply passed on to the ``ls`` command. For more information on functions, see the documentation for the :ref:`function <cmd-function>` builtin.
|
||||
|
||||
.. _syntax-function-wrappers:
|
||||
|
||||
|
@ -566,7 +566,7 @@ To provide a list of possible completions for myprog, use the ``-a`` switch. If
|
|||
complete -c myprog -s o -l output -a "yes no"
|
||||
|
||||
|
||||
There are also special switches for specifying that a switch requires an argument, to disable filename completion, to create completions that are only available in some combinations, etc.. For a complete description of the various switches accepted by the ``complete`` command, see the documentation for the `complete <cmds/complete.html>`_ builtin, or write ``complete --help`` inside the ``fish`` shell.
|
||||
There are also special switches for specifying that a switch requires an argument, to disable filename completion, to create completions that are only available in some combinations, etc.. For a complete description of the various switches accepted by the ``complete`` command, see the documentation for the :ref:`complete <cmd-complete>` builtin, or write ``complete --help`` inside the ``fish`` shell.
|
||||
|
||||
As a simple example, here's an excerpt of the completions for systemd's ``timedatectl``::
|
||||
|
||||
|
@ -719,7 +719,7 @@ Examples:
|
|||
|
||||
- ``**`` matches any files and directories in the current directory and all of its subdirectories.
|
||||
|
||||
Note that for most commands, if any wildcard fails to expand, the command is not executed, `$status <#variables-status>`_ is set to nonzero, and a warning is printed. This behavior is consistent with setting ``shopt -s failglob`` in bash. There are exactly 3 exceptions, namely `set <cmds/set.html>`_, `count <cmds/count.html>`_ and `for <cmds/for.html>`_. Their globs are permitted to expand to zero arguments, as with ``shopt -s nullglob`` in bash.
|
||||
Note that for most commands, if any wildcard fails to expand, the command is not executed, :ref:`$status <variables-status>` is set to nonzero, and a warning is printed. This behavior is consistent with setting ``shopt -s failglob`` in bash. There are exactly 3 exceptions, namely :ref:`set <cmd-set>`, :ref:`count <cmd-count>` and :ref:`for <cmd-for>`. Their globs are permitted to expand to zero arguments, as with ``shopt -s nullglob`` in bash.
|
||||
|
||||
Examples::
|
||||
|
||||
|
@ -1210,7 +1210,7 @@ The user can change the settings of ``fish`` by changing the values of certain v
|
|||
|
||||
- ``fish_user_paths``, an array of directories that are prepended to ``PATH``. This can be a universal variable.
|
||||
|
||||
- ``umask``, the current file creation mask. The preferred way to change the umask variable is through the `umask <cmds/umask.html>`_ function. An attempt to set umask to an invalid value will always fail.
|
||||
- ``umask``, the current file creation mask. The preferred way to change the umask variable is through the :ref:`umask <cmd-umask>` function. An attempt to set umask to an invalid value will always fail.
|
||||
|
||||
- ``BROWSER``, the user's preferred web browser. If this variable is set, fish will use the specified browser instead of the system default browser to display the fish documentation.
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ The user can change the settings of ``fish`` by changing the values of certain v
|
|||
|
||||
- ``hostname``, the machine's hostname.
|
||||
|
||||
- ``IFS``, the internal field separator that is used for word splitting with the `read <cmds/read.html>`_ builtin. Setting this to the empty string will also disable line splitting in `command substitution <#expand-command-substitution>`_. This variable can be changed by the user.
|
||||
- ``IFS``, the internal field separator that is used for word splitting with the :ref:`read <cmd-read>` builtin. Setting this to the empty string will also disable line splitting in `command substitution <#expand-command-substitution>`_. This variable can be changed by the user.
|
||||
|
||||
- ``PWD``, the current working directory.
|
||||
|
||||
|
@ -1375,7 +1375,7 @@ Builtin commands
|
|||
|
||||
Many other shells have a large library of builtin commands. Most of these commands are also available as standalone commands, but have been implemented in the shell anyway. To avoid code duplication, and to avoid the confusion of subtly differing versions of the same command, ``fish`` generally only implements builtins for actions which cannot be performed by a regular command.
|
||||
|
||||
For a list of all builtins, functions and commands shipped with fish, see the `list of commands <commands.html>`_. The documentation is also available by using the ``--help`` switch of the command.
|
||||
For a list of all builtins, functions and commands shipped with fish, see the :ref:`list of commands <Commands>`. The documentation is also available by using the ``--help`` switch of the command.
|
||||
|
||||
.. _editor:
|
||||
|
||||
|
@ -1486,7 +1486,7 @@ It is also possible to add all emacs-mode bindings to vi-mode by using something
|
|||
end
|
||||
|
||||
|
||||
When in vi-mode, the `fish_mode_prompt <cmds/fish_mode_prompt.html>`_ function will display a mode indicator to the left of the prompt. The ``fish_vi_cursor`` function will be used to change the cursor's shape depending on the mode in supported terminals. To disable this feature, override it with an empty function. To display the mode elsewhere (like in your right prompt), use the output of the ``fish_default_mode_prompt`` function.
|
||||
When in vi-mode, the :ref:`fish_mode_prompt <cmd-fish_mode_prompt>` function will display a mode indicator to the left of the prompt. The ``fish_vi_cursor`` function will be used to change the cursor's shape depending on the mode in supported terminals. To disable this feature, override it with an empty function. To display the mode elsewhere (like in your right prompt), use the output of the ``fish_default_mode_prompt`` function.
|
||||
|
||||
When a binding switches the mode, it will repaint the mode-prompt if it exists, and the rest of the prompt only if it doesn't. So if you want a mode-indicator in your ``fish_prompt``, you need to erase ``fish_mode_prompt`` e.g. by adding an empty file at `~/.config/fish/functions/fish_mode_prompt.fish`. (Bindings that change the mode are supposed to call the `repaint-mode` bind function, see :ref:`bind <cmd-bind>`)
|
||||
|
||||
|
@ -1608,7 +1608,7 @@ Normally when ``fish`` starts a program, this program will be put in the foregro
|
|||
|
||||
-# By pressing :kbd:`Control+Z`, the user stops a currently running foreground program and returns control to ``fish``. Some programs do not support this feature, or remap it to another key. GNU Emacs uses :kbd:`Control+X` :kbd:`z` to stop running.
|
||||
|
||||
-# By using the `bg <cmds/bg.html>`_ and `fg <cmds/fg.html>`_ builtin commands, the user can send any currently running job into the foreground or background.
|
||||
-# By using the :ref:`bg <cmd-bg>` and :ref:`fg <cmd-fg>` builtin commands, the user can send any currently running job into the foreground or background.
|
||||
|
||||
Note that functions cannot be started in the background. Functions that are stopped and then restarted in the background using the ``bg`` command will not execute correctly.
|
||||
|
||||
|
|
Loading…
Reference in a new issue