elvish/pkg/eval/builtin_fn_fs.d.elv
Qi Xiao 980cf009ca Parse comment blocks preceding var and fn declarations as doc comments.
Convert all .elv files (including .d.elv files) to use this new format.
2022-11-22 22:59:31 +00:00

26 lines
609 B
Plaintext

# Changes directory.
#
# This affects the entire process, including parallel tasks that are started
# implicitly (such as prompt functions) or explicitly (such as one started by
# [`peach`](#peach)).
#
# Note that Elvish's `cd` does not support `cd -`.
#
# @cf pwd
fn cd {|dirname| }
# If `$path` represents a path under the home directory, replace the home
# directory with `~`. Examples:
#
# ```elvish-transcript
# ~> echo $E:HOME
# /Users/foo
# ~> tilde-abbr /Users/foo
# ▶ '~'
# ~> tilde-abbr /Users/foobar
# ▶ /Users/foobar
# ~> tilde-abbr /Users/foo/a/b
# ▶ '~/a/b'
# ```
fn tilde-abbr {|path| }