summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zshrc2
1 files changed, 2 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
index fdf3d28..1626f3c 100644
--- a/.zshrc
+++ b/.zshrc
@@ -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=()