我一直在按照本指南https://thevaluable.dev/zsh-install-configure-mouseless/来设置我的 autocmp 。我在 MacOS 环境中,但由于某种原因,当我尝试自动完成选项时,它没有列出完整的选项集。这是我的自动完成配置:
#Completion
autoload -Uz compinit
compinit
zmodload zsh/complist
#Amazing article https://thevaluable.dev/zsh-install-configure-mouseless/
zstyle ':completion:*' completer _extensions _complete _approximate
zstyle ':completion:*' menu select
zstyle ':completion:*' file-sort modification
zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f'
zstyle ':completion:*' complete-options true
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*' #https://unix.stackexchange.com/a/259511
zstyle ':completion:*' verbose yes
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors 'di=34:fi=31:no=33;00'
# zstyle ':completion:*' file-list all #Unfortunetly this messes up colouring
#Move with VIM keys Autocompletion
bindkey '^[[Z' reverse-menu-complete
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
当我尝试自动完成内置 shell 命令的选项时,我得到以下信息:
❯ cp -
-- option --
-H -- follow symlinks on the command line in recursive mode
-L -- follow all symlinks in recursive mode
-P -- do not follow symlinks in recursive mode (default)
-R -- copy directories recursively
-X -- don\'t copy extended attributes or resource forks
-a -- archive mode, same as -RpP
-f -- force overwriting existing file
-i -- confirm before overwriting existing file
-n -- don\'t overwrite existing file
-p -- preserve timestamps, mode, owner, flags, ACLs, and extended attributes
-v -- show file names as they are copied
我希望获得cp
文章中的完整选项列表。这可能是 MacOs 中 zsh 补全的问题吗?