mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:03:57 +08:00
docs: Link builtins
When we say "the XYZ command/builtin", we should typically include a link. The exceptions are - In the documentation for that command - no need to link to ulimit in the ulimit page - When we've already linked before - not every thing needs to be clickable, or clicking it will cause the browser to mark fifty words as visited. This is roughly what wikipedia does for crosslinks. [ci skip]
This commit is contained in:
parent
8ddd512fba
commit
fd45877848
|
@ -19,7 +19,7 @@ Jobs in the list of jobs are sent a hang-up signal when fish terminates, which u
|
|||
|
||||
If no process is specified, the most recently-used job is removed (like :ref:`bg <cmd-bg>` and :ref:`fg <cmd-fg>`). If one or more PIDs are specified, jobs with the specified process IDs are removed from the job list. Invalid jobs are ignored and a warning is printed.
|
||||
|
||||
If a job is stopped, it is sent a signal to continue running, and a warning is printed. It is not possible to use the ``bg`` builtin to continue a job once it has been disowned.
|
||||
If a job is stopped, it is sent a signal to continue running, and a warning is printed. It is not possible to use the :ref:`bg <cmd-bg>` builtin to continue a job once it has been disowned.
|
||||
|
||||
``disown`` returns 0 if all specified jobs were disowned successfully, and 1 if any problems were encountered.
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ Description
|
|||
|
||||
``fish_key_reader`` is used to study input received from the terminal and can help with key binds. The program is interactive and works on standard input. Individual characters themselves and their hexadecimal values are displayed.
|
||||
|
||||
The tool will write an example ``bind`` command matching the character sequence captured to stdout. If the character sequence matches a special key name (see ``bind --key-names``), both ``bind CHARS ...`` and ``bind -k KEYNAME ...`` usage will be shown. Additional details about the characters received, such as the delay between chars, are written to stderr.
|
||||
The tool will write an example :ref:`bind <cmd-bind>` command matching the character sequence captured to stdout. If the character sequence matches a special key name (see ``bind --key-names``), both ``bind CHARS ...`` and ``bind -k KEYNAME ...`` usage will be shown. Additional details about the characters received, such as the delay between chars, are written to stderr.
|
||||
|
||||
The following options are available:
|
||||
|
||||
|
|
|
@ -27,4 +27,4 @@ Note that most builtin commands display their help in the terminal when given th
|
|||
Example
|
||||
-------
|
||||
|
||||
``help fg`` shows the documentation for the ``fg`` builtin.
|
||||
``help fg`` shows the documentation for the :ref:`fg <cmd-fg>` builtin.
|
||||
|
|
|
@ -30,7 +30,7 @@ jobs accepts the following switches:
|
|||
|
||||
On systems that supports this feature, jobs will print the CPU usage of each job since the last command was executed. The CPU usage is expressed as a percentage of full CPU activity. Note that on multiprocessor systems, the total activity may be more than 100\%.
|
||||
|
||||
The exit status of the ``jobs`` builtin is ``0`` if there are running background jobs and ``1`` otherwise.
|
||||
The exit status of ``jobs`` is ``0`` if there are running background jobs and ``1`` otherwise.
|
||||
|
||||
no output.
|
||||
----------
|
||||
|
|
|
@ -14,7 +14,7 @@ Synopsis
|
|||
Description
|
||||
-----------
|
||||
|
||||
``ulimit`` builtin sets or outputs the resource usage limits of the shell and any processes spawned by it. If a new limit value is omitted, the current value of the limit of the resource is printed; otherwise, the specified limit is set to the new value.
|
||||
``ulimit`` sets or outputs the resource usage limits of the shell and any processes spawned by it. If a new limit value is omitted, the current value of the limit of the resource is printed; otherwise, the specified limit is set to the new value.
|
||||
|
||||
Use one of the following switches to specify which resource limit to set or report:
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ Example::
|
|||
|
||||
echo hello world
|
||||
|
||||
This calls the ``echo`` command. ``echo`` is a command which will write its arguments to the screen. In the example above, the output will be 'hello world'. Everything in fish is done with commands. There are commands for performing a set of commands multiple times, commands for assigning variables, commands for treating a group of commands as a single command, etc.. And every single command follows the same basic syntax.
|
||||
This calls the :ref:`echo <cmd-echo>` command. ``echo`` is a command which will write its arguments to the screen. In the example above, the output will be 'hello world'. Everything in fish is done with commands. There are commands for performing a set of commands multiple times, commands for assigning variables, commands for treating a group of commands as a single command, etc.. And every single command follows the same basic syntax.
|
||||
|
||||
If you want to find out more about the echo command used above, read the manual page for the echo command by writing: ``man echo``
|
||||
|
||||
|
@ -394,7 +394,7 @@ It is very important that function definition files only contain the definition
|
|||
|
||||
Autoloading also won't work for `event handlers <#event>`_, since fish cannot know that a function is supposed to be executed when an event occurs when it hasn't yet loaded the function. See the `event handlers <#event>`_ section for more information.
|
||||
|
||||
Autoloading is not applicable to functions created by the ``alias`` command. For functions simple enough that you prefer to use the ``alias`` command to define them you'll need to put those commands in your ``~/.config/fish/config.fish`` script or some other script run when the shell starts.
|
||||
Autoloading is not applicable to functions created by the :ref:`alias <cmd-alias>` command. For functions simple enough that you prefer to use the ``alias`` command to define them you'll need to put those commands in your ``~/.config/fish/config.fish`` script or some other script run when the shell starts.
|
||||
|
||||
If you are developing another program, you may wish to install functions which are available for all users of the fish shell on a system. They can be installed to the "vendor" functions directory. As this path may vary from system to system, the ``pkgconfig`` framework should be used to discover this path with the output of ``pkg-config --variable functionsdir fish``. Your installation system should support a custom path to override the pkgconfig path, as other distributors may need to alter it easily.
|
||||
|
||||
|
@ -418,7 +418,7 @@ Conditional execution of code and flow control
|
|||
|
||||
There are four fish builtins that let you execute commands only if a specific criterion is met. These builtins are :ref:`if <cmd-if>`, :ref:`switch <cmd-switch>`, :ref:`and <cmd-and>` and :ref:`or <cmd-or>`.
|
||||
|
||||
The ``switch`` command is used to execute one of possibly many blocks of commands depending on the value of a string. See the documentation for :ref:`switch <cmd-switch>` for more information.
|
||||
The :ref:`switch <cmd-switch>` command is used to execute one of possibly many blocks of commands depending on the value of a string. See the documentation for :ref:`switch <cmd-switch>` for more information.
|
||||
|
||||
The other conditionals use the `exit status <#variables-status>`_ of a command to decide if a command or a block of commands should be executed. See their documentation for more information.
|
||||
|
||||
|
@ -490,11 +490,11 @@ The output of a series of commands can be used as the parameters to another comm
|
|||
|
||||
If the output is piped to :ref:`string split or string split0 <cmd-string-split>` as the last step, those splits are used as they appear and no additional splitting on newlines takes place.
|
||||
|
||||
The exit status of the last run command substitution is available in the `status <#variables-status>`_ variable if the substitution occurs in the context of a ``set`` command.
|
||||
The exit status of the last run command substitution is available in the `status <#variables-status>`_ variable if the substitution occurs in the context of a :ref:`set <cmd-set>` command.
|
||||
|
||||
Only part of the output can be used, see `index range expansion <#expand-index-range>`_ for details.
|
||||
|
||||
Fish has a default limit of 100 MiB on the amount of data a command substitution can output. If the limit is exceeded the entire command, not just the substitution, is failed and ``$status`` is set to 122. You can modify the limit by setting the ``fish_read_limit`` variable at any time including in the environment before fish starts running. If you set it to zero then no limit is imposed. This is a safety mechanism to keep the shell from consuming too much memory if a command outputs an unreasonable amount of data, typically your operating system also has a limit, and it's often much lower. Note that this limit also affects how much data the ``read`` command will process.
|
||||
Fish has a default limit of 100 MiB on the amount of data a command substitution can output. If the limit is exceeded the entire command, not just the substitution, is failed and ``$status`` is set to 122. You can modify the limit by setting the ``fish_read_limit`` variable at any time including in the environment before fish starts running. If you set it to zero then no limit is imposed. This is a safety mechanism to keep the shell from consuming too much memory if a command outputs an unreasonable amount of data, typically your operating system also has a limit, and it's often much lower. Note that this limit also affects how much data the :ref:`read <cmd-read>` command will process.
|
||||
|
||||
Examples::
|
||||
|
||||
|
@ -1011,7 +1011,7 @@ The user can change the settings of ``fish`` by changing the values of certain v
|
|||
|
||||
- ``PATH``, a list of directories in which to search for commands
|
||||
|
||||
- ``CDPATH``, a list of directories in which to search for the new directory for the ``cd`` builtin.
|
||||
- ``CDPATH``, a list of directories in which to search for the new directory for the :ref:`cd <cmd-cd>` builtin.
|
||||
|
||||
- ``LANG``, ``LC_ALL``, ``LC_COLLATE``, ``LC_CTYPE``, ``LC_MESSAGES``, ``LC_MONETARY``, ``LC_NUMERIC`` and ``LC_TIME`` set the language option for the shell and subprograms. See the section `Locale variables <#variables-locale>`_ for more information.
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ Help
|
|||
|
||||
``fish`` also has man pages for its commands. For example, ``man set`` will show the documentation for ``set`` as a man page.
|
||||
|
||||
Help on a specific builtin can also be obtained with the ``-h`` parameter. For instance, to obtain help on the ``fg`` builtin, either type ``fg -h`` or ``help fg``.
|
||||
Help on a specific builtin can also be obtained with the ``-h`` parameter. For instance, to obtain help on the :ref:`fg <cmd-fg>` builtin, either type ``fg -h`` or ``help fg``.
|
||||
|
||||
Autosuggestions
|
||||
---------------
|
||||
|
@ -1504,7 +1504,7 @@ Multiline editing
|
|||
|
||||
The fish commandline editor can be used to work on commands that are several lines long. There are three ways to make a command span more than a single line:
|
||||
|
||||
- Pressing the :kbd:`Enter` key while a block of commands is unclosed, such as when one or more block commands such as ``for``, ``begin`` or ``if`` do not have a corresponding ``end`` command.
|
||||
- Pressing the :kbd:`Enter` key while a block of commands is unclosed, such as when one or more block commands such as ``for``, ``begin`` or ``if`` do not have a corresponding :ref:`end <cmd-end>` command.
|
||||
|
||||
- Pressing :kbd:`Alt`\ +\ :kbd:`Enter` instead of pressing the :kbd:`Enter` key.
|
||||
|
||||
|
@ -1525,7 +1525,7 @@ Normally when ``fish`` starts a program, this program will be put in the foregro
|
|||
|
||||
- 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.
|
||||
Note that functions cannot be started in the background. Functions that are stopped and then restarted in the background using the :ref:`bg <cmd-bg>` command will not execute correctly.
|
||||
|
||||
|
||||
.. _initialization:
|
||||
|
|
|
@ -511,7 +511,7 @@ Note that ``case`` does not fall through, and can accept multiple arguments or (
|
|||
Functions
|
||||
---------
|
||||
|
||||
A ``fish`` function is a list of commands, which may optionally take arguments. Unlike other shells, arguments are not passed in "numbered variables" like ``$1``, but instead in a single list ``$argv``. To create a function, use the ``function`` builtin::
|
||||
A ``fish`` function is a list of commands, which may optionally take arguments. Unlike other shells, arguments are not passed in "numbered variables" like ``$1``, but instead in a single list ``$argv``. To create a function, use the :ref:`function <cmd-function>` builtin::
|
||||
|
||||
> function say_hello
|
||||
echo Hello $argv
|
||||
|
|
Loading…
Reference in New Issue
Block a user