From c4434d2ddedd62737ad3f99111ef47d722e2b74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20M-B?= Date: Sat, 5 Nov 2011 00:34:37 +0100 Subject: [PATCH] Update completion for SSH Add all hosts found in ~/.ssh/config. Tip found on: http://www.nerux.org/wiki/OpenSSH#coupler_avec_zsh_completion --- lib/completion.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/completion.zsh b/lib/completion.zsh index b3cc91822..dab9bb1d3 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -33,14 +33,17 @@ cdpath=(.) # use /etc/hosts and known_hosts for hostname completion [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() +[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(