From 8b1e79874cc126a10e01f98a4d0b1b93aca1cb9a Mon Sep 17 00:00:00 2001 From: Christian Sturm Date: Sat, 7 Feb 2015 14:03:10 +0100 Subject: [PATCH] zshrc: read host for ssh command completion from config --- etc/zsh/zshrc | 3 +++ 1 file changed, 3 insertions(+) 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)~~"$(