summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2019-05-16 09:15:38 +0200
committerFlorian Pritz <bluewind@xinu.at>2019-07-06 14:19:22 +0200
commit7665ee333713d46318e1b44b0e51289e4b3da933 (patch)
tree1ac5e25bed4eeec2dffb99871f6e44fd5f0fdfd6
parentc78fd9b59583d2549ab8fdb33af6f054442531e4 (diff)
downloaddotfiles-7665ee333713d46318e1b44b0e51289e4b3da933.tar.gz
dotfiles-7665ee333713d46318e1b44b0e51289e4b3da933.tar.xz
zshrc: Add sshrc completion
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-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=()