diff --git a/README.md b/README.md new file mode 100644 index 0000000..7bdfd9e --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# oh-my-zsh Deno plugin + +> The oh-my-zsh-deno plugin provides completion as well as adding many useful aliases. + +## Installation + +Clone or download in your oh-my-zsh custom plugin directory: + +```shell +git clone git@github.com:denodev/oh-my-zsh-deno.git ~/.oh-my-zsh/custom/plugins/deno +``` + +Add in your plugins list in `~/.zshrc`: + +```zsh +plugins=(... deno) +``` + +Restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration: + +```shell +source ~/.zshrc +``` + +## Aliases + +| Alias | Command | Descripton | +|:------ |:----------------|:-----------------------------------------------------------------------------| +| `denoa` | `deno run -A` | BRun a program given a filename or url to the module, allow all permissions | +| `denob` | `deno bundle` | Bundle module and dependencies into single file | +| `denoc` | `deno cache` | Cache the dependencies | +| `denod` | `deno doc` | Show documentation for a module | +| `denoe` | `deno eval` | Eval script | +| `denof` | `deno fmt` | Format source files | +| `denoi` | `deno install` | Install script as an executable | +| `denor` | `deno run` | Run a program given a filename or url to the module | +| `denot` | `deno test` | Run tests | +| `denoup` | `deno upgrade` | Upgrade deno executable to newest version | + +### License + +oh-my-zsh-deno is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details. diff --git a/deno.plugin.zsh b/deno.plugin.zsh new file mode 100644 index 0000000..47805ef --- /dev/null +++ b/deno.plugin.zsh @@ -0,0 +1,34 @@ +(( $+commands[deno] )) && { + deno completions bash > "${ZSH_CACHE_DIR:-$ZSH/cache}/deno_completions" + source "${ZSH_CACHE_DIR:-$ZSH/cache}/deno_completions" +} + +# Run a program given a filename or url to the module, allow all permissions +alias denoa="deno run -A " + +# Bundle module and dependencies into single file +alias denob="deno bundle" + +# Cache the dependencies +alias denoc="deno cache" + +# Show documentation for a module +alias denod="deno doc" + +# Eval script +alias denoe="deno eval" + +# Format source files +alias denof="deno fmt" + +# Install script as an executable +alias denoi="deno install" + +# Run a program given a filename or url to the module +alias denor="deno run" + +# Run tests +alias denot="deno test" + +# Upgrade deno executable to newest version +alias denoup="deno upgrade"