在 ZSH 中启用菜单式自动补全

问题:

You have installed zsh but you don’t see the menu-style autocompletion (where you can navigate the suggestions using the arrow keys on the keyboard)

解决方案

打开终端并运行此命令:

enable_zsh_menu_completion.sh
echo "zstyle ':completion:*' menu select" >> ~/.zshrc

之后,重启 zsh(例如在当前终端中输入 zsh,但这只对当前终端会话有效)。如果不确定,重启你的计算机。

注意上面的命令只为当前用户启用菜单式自动补全。

因此你需要为每个想启用 zsh 自动补全的用户执行此命令。

或者,如果你有 root 权限,你可以为所有用户启用它:

enable_zsh_menu_completion_all_users.sh
sudo echo "zstyle ':completion:*' menu select" >> /etc/zsh/zshrc

Check out similar posts by category: Shell