Kevin Burke e86c6f5e7f style: use `-n` flag in `head` and `tail` commands (#10391) | 3 years ago | |
---|---|---|
.. | ||
README.md | 4 years ago | |
_scd | 4 years ago | |
scd | 3 years ago | |
scd.plugin.zsh | 4 years ago |
Define scd
shell function for changing to any directory with
a few keystrokes.
scd
keeps history of the visited directories, which serves as an index of
the known paths. The directory index is updated after every cd
command in
the shell and can be also filled manually by running scd -a
. To switch to
some directory, scd
needs few fragments of the desired path to match with
the index. A selection menu is displayed in case of several matches, with a
preference given to recently visited paths. scd
can create permanent
directory aliases, which appear as named directories in zsh session.
Besides oh-my-zsh, scd
can be used with bash, dash or tcsh
shells and is also available as Vim plugin
scd.vim and
IPython extension. For installation details, see
https://github.com/pavoljuhas/smart-change-directory.
scd [options] [pattern1 pattern2 ...]
Patterns may use all zsh glob operators available with extendedglob option. Specified patterns must match the absolute path and at least one of them must match in the tail. Several special patterns are also recognized as follows:
# Index recursively some paths for the very first run
scd -ar ~/Documents/
# Change to a directory path matching "doc"
scd doc
# Change to a path matching all of "a", "b" and "c"
scd a b c
# Change to a directory path that ends with "ts"
scd "ts$"
# Show selection menu and ranking of 20 most likely directories
scd -v
# Alias current directory as "xray"
scd --alias=xray
# Jump to a previously defined aliased directory
scd xray
/mnt/backup/*
. The patterns are specified one per line
and are matched assuming the extendedglob zsh option. Lines
starting with "#" are skipped as comments. The .scdignore patterns
are not applied in the --all mode.cd
command. This variable must be defined when scd runs in its own
process rather than as a shell function. It is up to the
scd caller to use the output in SCD_SCRIPT.