Skip to content

Commit

Permalink
fix(common-aliases): don't overshadow duf if installed (ohmyzsh#11112)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanDanyk authored and kareefardi committed Oct 14, 2022
1 parent 0271aa3 commit 36be211
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion plugins/common-aliases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/common-aliases/common-aliases.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit 36be211

Please sign in to comment.