diff options
author | Florian Pritz <bluewind@xinu.at> | 2019-05-16 09:15:38 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2019-07-06 14:19:22 +0200 |
commit | 7665ee333713d46318e1b44b0e51289e4b3da933 (patch) | |
tree | 1ac5e25bed4eeec2dffb99871f6e44fd5f0fdfd6 | |
parent | c78fd9b59583d2549ab8fdb33af6f054442531e4 (diff) | |
download | dotfiles-7665ee333713d46318e1b44b0e51289e4b3da933.tar.gz dotfiles-7665ee333713d46318e1b44b0e51289e4b3da933.tar.xz |
zshrc: Add sshrc completion
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | .zshrc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -660,6 +660,8 @@ zstyle ':completion:*:wine:*' file-patterns '*.(exe|EXE):exe' # don't complete usernames (the come from localhost!) zstyle ':completion:*:(ssh|scp):*' users +compdef sshrc=ssh + # complete ssh hostnames [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}%%:*}#\[}%\]}) || _ssh_hosts=() [[ -r ~/.ssh/config ]] && _ssh_config_hosts=($(sed -rn 's/host\s+(.+)/\1/ip' "$HOME/.ssh/config" | grep -v "\*" )) || _ssh_config_hosts=() |