diff options
author | Robby Russell <robby@planetargon.com> | 2013-04-23 21:27:51 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-04-23 21:27:51 -0700 |
commit | b6ea876971b2270a2c73a07a6f6a337604132c6f (patch) | |
tree | b95edef68a19b210e3cb9fb91ef8160c8d1058ee /lib/completion.zsh | |
parent | fd50759e39a8b0e27f56f1e56a8240de541d8271 (diff) | |
parent | 07838055a85bb751e15f072ba2fdc96e9b5ec92b (diff) | |
download | zsh-b6ea876971b2270a2c73a07a6f6a337604132c6f.tar.gz zsh-b6ea876971b2270a2c73a07a6f6a337604132c6f.tar.bz2 zsh-b6ea876971b2270a2c73a07a6f6a337604132c6f.zip |
Merge pull request #690 from essembeh/master
Adding ~/.ssh/config parsing for host list and theme.
Diffstat (limited to 'lib/completion.zsh')
-rw-r--r-- | lib/completion.zsh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh index ba839a067..e0cdcf626 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -34,8 +34,10 @@ cdpath=(.) # use /etc/hosts and known_hosts for hostname completion [ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=() [ -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)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=() hosts=( + "$_ssh_config[@]" "$_global_ssh_hosts[@]" "$_ssh_hosts[@]" "$_etc_hosts[@]" @@ -43,6 +45,7 @@ hosts=( localhost ) zstyle ':completion:*:hosts' hosts $hosts +zstyle ':completion:*' users off # Use caching so that commands like apt and dpkg complete are useable zstyle ':completion::complete:*' use-cache 1 |