mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-26 14:01:13 -03:00
docs: use canonical key names in :kbd: tags
This seems a bit better because it's what bind uses. To makes sure that something like :kbd:`ctrl-x` looks good in HTML, remove the border from the kbd style. Else both "ctrl" and "x" get small boxes which looks weird.
This commit is contained in:
@@ -25,8 +25,8 @@ Description
|
||||
Only typed-in commands use abbreviations. Abbreviations are not expanded in scripts.
|
||||
|
||||
For example, a frequently-run command like ``git checkout`` can be abbreviated to ``gco``.
|
||||
After entering ``gco`` and pressing :kbd:`Space` or :kbd:`Enter`, the full text ``git checkout`` will appear in the command line.
|
||||
To avoid expanding something that looks like an abbreviation, the default :kbd:`Control`\ +\ :kbd:`Space` binding inserts a space without expanding.
|
||||
After entering ``gco`` and pressing :kbd:`space` or :kbd:`enter`, the full text ``git checkout`` will appear in the command line.
|
||||
To avoid expanding something that looks like an abbreviation, the default :kbd:`ctrl-space` binding inserts a space without expanding.
|
||||
|
||||
An abbreviation may match a literal word, or it may match a pattern given by a regular expression. When an abbreviation matches a word, that word is replaced by new text, called its *expansion*. This expansion may be a fixed new phrase, or it can be dynamically created via a fish function. This expansion occurs after pressing space or enter.
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ If only ``KEYS`` is given, any existing binding in the given ``MODE`` will be pr
|
||||
|
||||
``KEYS`` is a comma-separated list of key names.
|
||||
Modifier keys can be specified by prefixing a key name with a combination of ``ctrl-``/``c-``, ``alt-``/``a-`` and ``shift-``.
|
||||
For example, :kbd:`Alt`\ +\ :kbd:`w` is written as ``alt-w``.
|
||||
For example, pressing :kbd:`w` while holding the Alt modifier is written as ``alt-w``.
|
||||
Key names are case-sensitive; for example ``alt-W`` is the same as ``alt-shift-w``.
|
||||
|
||||
Some keys have names, usually because they don't have an obvious printable character representation.
|
||||
@@ -364,22 +364,22 @@ The following functions are included as normal functions, but are particularly u
|
||||
Examples
|
||||
--------
|
||||
|
||||
Exit the shell when :kbd:`Control`\ +\ :kbd:`D` is pressed::
|
||||
Exit the shell when :kbd:`ctrl-d` is pressed::
|
||||
|
||||
bind ctrl-d 'exit'
|
||||
|
||||
Perform a history search when :kbd:`Page Up` is pressed::
|
||||
Perform a history search when :kbd:`pageup` is pressed::
|
||||
|
||||
bind -k ppage history-search-backward
|
||||
bind pageup history-search-backward
|
||||
|
||||
Turn on :ref:`vi key bindings <vi-mode>` and rebind :kbd:`Control`\ +\ :kbd:`C` to clear the input line::
|
||||
Turn on :ref:`vi key bindings <vi-mode>` and rebind :kbd:`ctrl-c` to clear the input line::
|
||||
|
||||
set -g fish_key_bindings fish_vi_key_bindings
|
||||
bind -M insert \cc kill-whole-line repaint
|
||||
bind -M insert ctrl-c kill-whole-line repaint
|
||||
|
||||
Launch ``git diff`` and repaint the commandline afterwards when :kbd:`Control`\ +\ :kbd:`G` is pressed::
|
||||
Launch ``git diff`` and repaint the commandline afterwards when :kbd:`ctrl-g` is pressed::
|
||||
|
||||
bind \cg 'git diff' repaint
|
||||
bind ctrl-g 'git diff' repaint
|
||||
|
||||
.. _cmd-bind-termlimits:
|
||||
|
||||
@@ -390,10 +390,10 @@ Unix terminals, like the ones fish operates in, are at heart 70s technology. The
|
||||
|
||||
For instance, the control key modifies a character by setting the top three bits to 0. This means:
|
||||
|
||||
- Many characters + control are indistinguishable from other keys. :kbd:`Control`\ +\ :kbd:`I` *is* tab, :kbd:`Control`\ +\ :kbd:`J` *is* newline (``\n``).
|
||||
- Many characters + control are indistinguishable from other keys: :kbd:`ctrl-i` *is* :kbd:`tab`, :kbd:`ctrl-j` *is* newline (``\n``).
|
||||
- Control and shift don't work simultaneously
|
||||
|
||||
Other keys don't have a direct encoding, and are sent as escape sequences. For example :kbd:`→` (Right) often sends ``\e\[C``. These can differ from terminal to terminal, and the mapping is typically available in `terminfo(5)`. Sometimes however a terminal identifies as e.g. ``xterm-256color`` for compatibility, but then implements xterm's sequences incorrectly.
|
||||
Other keys don't have a direct encoding, and are sent as escape sequences. For example :kbd:`right` (``→``) often sends ``\e\[C``. These can differ from terminal to terminal, and the mapping is typically available in `terminfo(5)`. Sometimes however a terminal identifies as e.g. ``xterm-256color`` for compatibility, but then implements xterm's sequences incorrectly.
|
||||
|
||||
.. _cmd-bind-escape:
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Description
|
||||
|
||||
``cdh`` with no arguments presents a list of :ref:`recently visited directories <directory-history>`.
|
||||
You can then select one of the entries by letter or number.
|
||||
You can also press :kbd:`Tab` to use the completion pager to select an item from the list.
|
||||
You can also press :kbd:`tab` to use the completion pager to select an item from the list.
|
||||
If you give it a single argument it is equivalent to ``cd DIRECTORY``.
|
||||
|
||||
Note that the ``cd`` command limits directory history to the 25 most recently visited directories.
|
||||
|
||||
@@ -19,7 +19,7 @@ The ``fish_clipboard_copy`` function copies text to the system clipboard.
|
||||
|
||||
If stdin is not a terminal (see :doc:`isatty <isatty>`), it will read all input from there and copy it. If it is, it will use the current commandline, or the current selection if there is one.
|
||||
|
||||
It is bound to :kbd:`Control`\ +\ :kbd:`X` by default.
|
||||
It is bound to :kbd:`ctrl-x` by default.
|
||||
|
||||
``fish_clipboard_copy`` works by calling a system-specific backend. If it doesn't appear to work you may need to install yours.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ If its stdout is not a terminal (see :doc:`isatty <isatty>`), it will output eve
|
||||
|
||||
If it outputs to the commandline, it will automatically escape the output if the cursor is currently inside single-quotes so it is suitable for single-quotes (meaning it escapes ``'`` and ``\\``).
|
||||
|
||||
It is bound to :kbd:`Control`\ +\ :kbd:`V` by default.
|
||||
It is bound to :kbd:`ctrl-v` by default.
|
||||
|
||||
``fish_clipboard_paste`` works by calling a system-specific backend. If it doesn't appear to work you may need to install yours.
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ Usage Notes
|
||||
|
||||
``fish_key_reader`` intentionally disables handling of many signals. To terminate ``fish_key_reader`` in ``--continuous`` mode do:
|
||||
|
||||
- press :kbd:`Control`\ +\ :kbd:`C` twice, or
|
||||
- press :kbd:`Control`\ +\ :kbd:`D` twice, or
|
||||
- press :kbd:`ctrl-c` twice, or
|
||||
- press :kbd:`ctrl-d` twice, or
|
||||
- type ``exit``, or
|
||||
- type ``quit``
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Description
|
||||
|
||||
``funced`` provides an interface to edit the definition of the function *NAME*.
|
||||
|
||||
If the ``$VISUAL`` environment variable is set, it will be used as the program to edit the function. If ``$VISUAL`` is unset but ``$EDITOR`` is set, that will be used. Otherwise, a built-in editor will be used. Note that to enter a literal newline using the built-in editor you should press :kbd:`Alt`\ +\ :kbd:`Enter`. Pressing :kbd:`Enter` signals that you are done editing the function. This does not apply to an external editor like emacs or vim.
|
||||
If the ``$VISUAL`` environment variable is set, it will be used as the program to edit the function. If ``$VISUAL`` is unset but ``$EDITOR`` is set, that will be used. Otherwise, a built-in editor will be used. Note that to enter a literal newline using the built-in editor you should press :kbd:`alt-enter`. Pressing :kbd:`enter` signals that you are done editing the function. This does not apply to an external editor like emacs or vim.
|
||||
|
||||
``funced`` will try to edit the original file that a function is defined in, which might include variable definitions or helper functions as well. If changes cannot be saved to the original file, a copy will be created in the user's function directory.
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ The following options are available:
|
||||
This will not trigger for :doc:`disowned <disown>` jobs.
|
||||
|
||||
**-s** *SIGSPEC* or **--on-signal** *SIGSPEC*
|
||||
Run this function when the signal ``SIGSPEC`` is delivered. ``SIGSPEC`` can be a signal number, or the signal name, such as ``SIGHUP`` (or just ``HUP``). Note that the signal must have been delivered to :program:`fish`; for example, :kbd:`Ctrl-C` sends ``SIGINT`` to the foreground process group, which will not be :program:`fish` if you are running another command at the time. Observing a signal will prevent fish from exiting in response to that signal.
|
||||
Run this function when the signal ``SIGSPEC`` is delivered. ``SIGSPEC`` can be a signal number, or the signal name, such as ``SIGHUP`` (or just ``HUP``). Note that the signal must have been delivered to :program:`fish`; for example, :kbd:`ctrl-c` sends ``SIGINT`` to the foreground process group, which will not be :program:`fish` if you are running another command at the time. Observing a signal will prevent fish from exiting in response to that signal.
|
||||
|
||||
**-S** or **--no-scope-shadowing**
|
||||
Allows the function to access the variables of calling functions. Normally, any variables inside the function that have the same name as variables from the calling function are "shadowed", and their contents are independent of the calling function.
|
||||
|
||||
Reference in New Issue
Block a user