From 7665ee333713d46318e1b44b0e51289e4b3da933 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 16 May 2019 09:15:38 +0200 Subject: zshrc: Add sshrc completion Signed-off-by: Florian Pritz --- .zshrc | 2 ++ 1 file changed, 2 insertions(+) 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=() -- cgit v1.2.3-24-g4f1b