fish-shell/doc_src/cmds/cdh.rst
Fabian Boehm 38b24c2325 docs: Use :doc: role when linking to commands
This makes it so we link to the very top of the document instead of a
special anchor we manually include.

So clicking e.g. :doc:`string <cmds/string>` will link you to
cmds/string.html instead of cmds/string.html#cmd-string.

I would love to have a way to say "this document from the root of the
document path", but that doesn't appear to work, I tried
`/cmds/string`.

So we'll just have to use cmds/string in normal documents and plain
`string` from other commands.
2022-09-24 10:56:43 +02:00

30 lines
1,004 B
ReStructuredText

.. _cmd-cdh:
cdh - change to a recently visited directory
============================================
Synopsis
--------
.. synopsis::
cdh [DIRECTORY]
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.
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.
The history is stored in the :envvar:`dirprev` and :envvar:`$dirnext` variables, which this command manipulates.
If you make those universal variables, your ``cd`` history is shared among all fish instances.
See Also
--------
- the :doc:`dirh <dirh>` command to print the directory history
- the :doc:`prevd <prevd>` command to move backward
- the :doc:`nextd <nextd>` command to move forward