diff options
author | Marc Cornellà <marc.cornella@live.com> | 2020-12-09 23:17:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 23:17:53 +0100 |
commit | e4082a951fe28a3da3ff63cec2b2c03fc04373c1 (patch) | |
tree | ddda85961387e99b3af1fe0a71931891464d2e2b /plugins/common-aliases | |
parent | e5af22cca6a07c9be52fe48810faaa08261e4d15 (diff) | |
parent | 5feb2b67428546c7e50b510f9d644ce24e1d5c43 (diff) | |
download | zsh-e4082a951fe28a3da3ff63cec2b2c03fc04373c1.tar.gz zsh-e4082a951fe28a3da3ff63cec2b2c03fc04373c1.tar.bz2 zsh-e4082a951fe28a3da3ff63cec2b2c03fc04373c1.zip |
fix(common-aliases)!: don't overshadow `fd` if installed (#9162)
BREAKING CHANGE: in `common-aliases`, the `fd` alias won't be defined if `fd` is installed (https://github.com/sharkdp/fd).
Diffstat (limited to 'plugins/common-aliases')
-rw-r--r-- | plugins/common-aliases/README.md | 4 | ||||
-rw-r--r-- | plugins/common-aliases/common-aliases.plugin.zsh | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/common-aliases/README.md b/plugins/common-aliases/README.md index d198a29ac..b6f34cb54 100644 --- a/plugins/common-aliases/README.md +++ b/plugins/common-aliases/README.md @@ -40,11 +40,13 @@ plugins=(... common-aliases) | Alias | Command | Description | |-------|-----------------------------------------------------|-----------------------------------------| -| fd | `find . -type d -name` | Find a directory with the given name | +| fd\* | `find . -type d -name` | Find a directory with the given name | | ff | `find . -type f -name` | Find a file with the given name | | grep | `grep --color` | Searches for a query string | | sgrep | `grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}` | Useful for searching within files | +\* Only if the [`fd`](https://github.com/sharkdp/fd) command isn't installed. + ### Other Aliases | Alias | Command | Description | diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index a9d4f1a3d..4e5ff848f 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -34,7 +34,7 @@ alias -g P="2>&1| pygmentize -l pytb" alias dud='du -d 1 -h' alias duf='du -sh *' -alias fd='find . -type d -name' +(( $+commands[fd] )) || alias fd='find . -type d -name' alias ff='find . -type f -name' alias h='history' |