summaryrefslogtreecommitdiff
path: root/plugins/common-aliases
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/common-aliases')
-rw-r--r--plugins/common-aliases/README.md4
-rw-r--r--plugins/common-aliases/common-aliases.plugin.zsh8
2 files changed, 7 insertions, 5 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 023b1a51e..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'
@@ -55,15 +55,15 @@ if is-at-least 4.2.0; then
# open browser on urls
if [[ -n "$BROWSER" ]]; then
_browser_fts=(htm html de org net com at cx nl se dk)
- for ft in $_browser_fts; do alias -s $ft=$BROWSER; done
+ for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
fi
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
- for ft in $_editor_fts; do alias -s $ft=$EDITOR; done
+ for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
if [[ -n "$XIVIEWER" ]]; then
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
- for ft in $_image_fts; do alias -s $ft=$XIVIEWER; done
+ for ft in $_image_fts; do alias -s $ft='$XIVIEWER'; done
fi
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)