Skip to main content
On this page

deno completions

您可以使用输出脚本来配置 deno 命令的自动补全。

Note

如果你通过 Homebrew 安装了 Deno,只要你的 shell 已配置为从 Homebrew 的补全目录加载补全脚本,shell 补全就会自动安装并保持最新。在这种情况下,你无需手动运行 deno completions

Examples Jump to heading

示例 Jump to heading

配置 Bash shell 补全 Jump to heading

>_
deno completions bash > deno.bash

if [ -d "/usr/local/etc/bash_completion.d/" ]; then
  sudo mv deno.bash /usr/local/etc/bash_completion.d/
  source /usr/local/etc/bash_completion.d/deno.bash
elif [ -d "/usr/share/bash-completion/completions/" ]; then
  sudo mv deno.bash /usr/share/bash-completion/completions/
  source /usr/share/bash-completion/completions/deno.bash
else
  echo "请将 deno.bash 移动到合适的 bash 补全目录"
fi

配置 PowerShell shell 补全 Jump to heading

>_
deno completions powershell | Out-String | Invoke-Expression

配置 zsh shell 补全 Jump to heading

首先将以下内容添加到你的 .zshrc 文件中:

>_
fpath=(~/.zsh/completion $fpath)
autoload -U compinit
compinit

然后运行以下命令:

>_
deno completions zsh > _deno
mv _deno ~/.zsh/completion/_deno
autoload -U compinit && compinit

配置 fish shell 补全 Jump to heading

>_
deno completions fish > completions.fish
chmod +x ./completions.fish
Command line usage:
deno completions [OPTIONS] [shell]

Output shell completion script to standard output.

deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
source /usr/local/etc/bash_completion.d/deno.bash

Options Jump to heading

Generate dynamic completions for the given shell (unstable), currently this only provides available tasks for deno task.

Last updated on

Did you find what you needed?

编辑此页面
Privacy policy