【问题标题】:ZSH extends bash autocompletion [closed]ZSH 扩展了 bash 自动完成功能
【发布时间】:2020-09-23 14:47:37
【问题描述】:

可以让 ZSH 扩展 bash 自动补全吗? Bash 几乎可以自动完成系统中的所有命令,而在 ZSH 中我总是需要为其启用插件。

这是一个示例(忽略警告,来自在 bash 中不起作用的自定义脚本)

【问题讨论】:

  • 不知道zsh有没有内置的自动补全。我只能建议您使用插件...
  • 这里不是主题; Stack Overflow 专门针对关于开发软件的问题。考虑Super UserUnix & Linux 作为用户与 UNIX 工具交互的问题。

标签: linux bash ubuntu command-line zsh


【解决方案1】:

你可以安装项目zsh-completions

(https://github.com/zsh-users/zsh-completions)

来自 Ubuntu 软件包
echo "deb http://download.opensuse.org/repositories/shells:/zsh-users:/zsh-completions/xUbuntu_19.10/ /" | sudo tee /etc/apt/sources.list.d/shells:zsh-users:zsh-completions.list
curl -fsSL https://download.opensuse.org/repositories/shells:zsh-users:zsh-completions/xUbuntu_19.10/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells:zsh-users:zsh-completions.gpg > /dev/null
sudo apt update
sudo apt install zsh-completions
来自 Gitub 存储库
  • 克隆存储库:
git clone git://github.com/zsh-users/zsh-completions.git
  • 在 $fpath 中包含目录,例如通过添加 ~/.zshrc:
fpath=(path/to/zsh-completions/src $fpath)
  • 您可能必须强制重建 zcompdump:
rm -f ~/.zcompdump; compinit

【讨论】:

    猜你喜欢
    • 2014-06-17
    • 2022-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-11
    • 1970-01-01
    • 2023-03-06
    • 2012-05-28
    相关资源
    最近更新 更多