From e493f57d5a300b59aa18d12a10545cefe7317dcc Mon Sep 17 00:00:00 2001 From: tfheen Date: Tue, 5 Jun 2012 15:25:53 +0000 Subject: [PATCH] Add support for debian.org hosts to tab completion too git-svn-id: file:///svn/tfheen/trunk/dotfiles@1542 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- zshfunc/update-debhosts | 10 ++++++++++ zshrc | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 zshfunc/update-debhosts diff --git a/zshfunc/update-debhosts b/zshfunc/update-debhosts new file mode 100644 index 0000000..dfd5f96 --- /dev/null +++ b/zshfunc/update-debhosts @@ -0,0 +1,10 @@ +# -*- sh -*- +## vim:ft=zsh:foldmethod=marker + +( + printf "DEBHOSTS=( " + ldapsearch -ZZ -b dc=debian,dc=org -h db.debian.org -x '(host=*)' hostname | awk -F: '$1 == "hostname" {print $2}' | tr -d '\n' + printf ")\n" +) > ~/.zshrc.d/60_debhosts + +. ~/.zshrc.d/60_debhosts diff --git a/zshrc b/zshrc index fd719d6..8e4fe03 100644 --- a/zshrc +++ b/zshrc @@ -191,8 +191,10 @@ unset paths # Don't beep. Ever. setopt -B +hosts=( $DEBHOSTS ) + if [ -e ~/.ssh/known_hosts ]; then - hosts=(`awk -F "[, ]" '{print $1}' ~/.ssh/known_hosts`) + hosts=($hosts `awk -F "[, ]" '{print $1}' ~/.ssh/known_hosts`) fi if [ -e ~/.ssh/known_hosts2 ]; then hosts=($hosts `awk -F "[, ]" '{print $1}' ~/.ssh/known_hosts2`) -- 2.39.5