From: Christian Sturm Date: Sat, 7 Feb 2015 13:03:10 +0000 (+0100) Subject: zshrc: read host for ssh command completion from config X-Git-Tag: v0.11.0~6 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=8b1e79874cc126a10e01f98a4d0b1b93aca1cb9a zshrc: read host for ssh command completion from config --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 09ebfc7..2ab3f85 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -764,14 +764,17 @@ grmlcomp() { # host completion if is42 ; then + [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${${(@M)${(f)"$(cat $HOME/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) || _ssh_config_hosts=() [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(