diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2022-11-05 14:55:11 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2022-11-05 14:55:11 -0700 |
commit | 04b8c052e5b624873b352889423c753ed1baf9c4 (patch) | |
tree | 78e14fe69e61d69709f31f91b7ae29fe8bc74477 /plugins/common-aliases | |
parent | 1a6dcd017dbf564058a729032de3db139fcf9c7e (diff) | |
parent | 80fdbc9b91a9acca42fb90065b5e64a9722978a7 (diff) | |
download | zsh-04b8c052e5b624873b352889423c753ed1baf9c4.tar.gz zsh-04b8c052e5b624873b352889423c753ed1baf9c4.tar.bz2 zsh-04b8c052e5b624873b352889423c753ed1baf9c4.zip |
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'plugins/common-aliases')
-rw-r--r-- | plugins/common-aliases/README.md | 7 | ||||
-rw-r--r-- | plugins/common-aliases/common-aliases.plugin.zsh | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/common-aliases/README.md b/plugins/common-aliases/README.md index 0354c7a3f..1417c3056 100644 --- a/plugins/common-aliases/README.md +++ b/plugins/common-aliases/README.md @@ -35,9 +35,11 @@ plugins=(... common-aliases) | mv | `mv -i` | Move a file | | zshrc | `${=EDITOR} ~/.zshrc` | Quickly access the ~/.zshrc file | | dud | `du -d 1 -h` | Display the size of files at depth 1 in current location in human-readable form | -| duf | `du -sh` | Display the size of files in current location in human-readable form | +| duf\* | `du -sh` | Display the size of files in current location in human-readable form | | t | `tail -f` | Shorthand for tail which outputs the last part of a file | +\* Only if the [`duf`](https://github.com/muesli/duf) command isn't installed. + ### find and grep | Alias | Command | Description | @@ -66,12 +68,15 @@ These aliases are expanded in any position in the command line, meaning you can end of the command you've typed. Examples: Quickly pipe to less: + ```zsh $ ls -l /var/log L # will run $ ls -l /var/log | less ``` + Silences stderr output: + ```zsh $ find . -type f NE # will run diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 8b58b6310..3139b821a 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -35,7 +35,7 @@ alias -g NUL="> /dev/null 2>&1" alias -g P="2>&1| pygmentize -l pytb" alias dud='du -d 1 -h' -alias duf='du -sh *' +(( $+commands[duf] )) || alias duf='du -sh *' (( $+commands[fd] )) || alias fd='find . -type d -name' alias ff='find . -type f -name' |