diff --git a/plugins/deno/README.md b/plugins/deno/README.md index 38f9f2033..3fea93ee6 100644 --- a/plugins/deno/README.md +++ b/plugins/deno/README.md @@ -2,19 +2,23 @@ This plugin sets up completion and aliases for [Deno](https://deno.land). +To use it, add `deno` to the plugins array in your zshrc file: + +```zsh +plugins=(... deno) +``` + ## Aliases -| Alias | Full command | -| ----- | ------------------- | -| db | deno bundle | -| dc | deno compile | -| dca | deno cache | -| dfmt | deno fmt | -| dh | deno help | -| dli | deno lint | -| drn | deno run | -| drA | deno run -A | -| drw | deno run --watch | -| dru | deno run --unstable | -| dts | deno test | -| dup | deno upgrade | +| Alias | Full command | +| ----- | ---------------- | +| dc | deno compile | +| dca | deno cache | +| dfmt | deno fmt | +| dh | deno help | +| dli | deno lint | +| drn | deno run | +| drA | deno run -A | +| drw | deno run --watch | +| dts | deno test | +| dup | deno upgrade | diff --git a/plugins/deno/deno.plugin.zsh b/plugins/deno/deno.plugin.zsh index bf97d6f03..094bfad28 100644 --- a/plugins/deno/deno.plugin.zsh +++ b/plugins/deno/deno.plugin.zsh @@ -1,5 +1,9 @@ +# Return immediately if deno is not found +if (( ! ${+commands[deno]} )); then + return +fi + # ALIASES -alias db='deno bundle' alias dc='deno compile' alias dca='deno cache' alias dfmt='deno fmt' @@ -8,15 +12,10 @@ alias dli='deno lint' alias drn='deno run' alias drA='deno run -A' alias drw='deno run --watch' -alias dru='deno run --unstable' alias dts='deno test' alias dup='deno upgrade' # COMPLETION FUNCTION -if (( ! $+commands[deno] )); then - return -fi - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `deno`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_deno" ]]; then