Skip to content

Commit

Permalink
add deno completions
Browse files Browse the repository at this point in the history
Signed-off-by: 迷渡 <justjavac@gmail.com>
  • Loading branch information
justjavac committed May 7, 2020
1 parent eb53d1e commit 0c41a76
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
34 changes: 34 additions & 0 deletions deno.plugin.zsh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 0c41a76

Please sign in to comment.