Fix ssh completion for ~/.ssh/config

Ref: https://www.zsh.org/mla/users/2015/msg00467.html

and `which _ssh_hosts`

Fixes #46
This commit is contained in:
Matt Hamilton 2018-09-17 01:28:26 -04:00
parent fe2cb6b9f5
commit 221c421f92
1 changed files with 4 additions and 0 deletions

View File

@ -92,3 +92,7 @@ zstyle ':completion:*:history-words' menu yes
# ignore multiple entries.
zstyle ':completion:*:(rm|kill|diff):*' ignore-line other
zstyle ':completion:*:rm:*' file-patterns '*:all-files'
# fix ssh not completing with hosts from ~/.ssh/config
zstyle -e ':completion:*:*:ssh:*:my-accounts' users-hosts \
'[[ -f ~/.ssh/config && $key = hosts ]] && key=my_hosts reply=()'