From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17187 invoked by alias); 7 Apr 2015 15:53:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20107 Received: (qmail 23177 invoked from network); 7 Apr 2015 15:53:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3fK4rdVzQ49Uwsucn7FnxT7ojdYf3I2M36XL7INbCLk=; b=I/ZC8hJZn5RpM8qKDfFwzak7hJoan/OwixffDxwn8a3ORZAc/scpUTXtJRwNZxkh5q aOsfs/18u5DuqPkVdSZo2wDEiVf3t8JO+y83Uqss9Ut0gSLI/7JeAy/HEJm3GOKkEU5b 1Mnta4Rs2G43xdqqvC3JH7qrsCIyP5uLCwsE7piX1tcS7AfaIkrgS5c8gwk4FbeqCkZn 2crVrXyxLa5PGIUdBgY64JAp4KkTBFi0r8VA6xPMD9fisj0LpnsQP6jS6D7AB4GO4VtQ fEwwtNrVFgKAvVQNWRAljJSHfr4UI7MJhY5YATSSmG/1U6Gj50F6A558DOR682rbpcce yBCA== MIME-Version: 1.0 X-Received: by 10.50.90.179 with SMTP id bx19mr4709219igb.43.1428422023529; Tue, 07 Apr 2015 08:53:43 -0700 (PDT) In-Reply-To: <1797284.9M4pHoONQN@note> References: <1797284.9M4pHoONQN@note> Date: Tue, 7 Apr 2015 17:53:43 +0200 Message-ID: Subject: Re: Ssh completion from ~/.ssh/config From: Mikael Magnusson To: "Vadim A. Misbakh-Soloviov" Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Tue, Apr 7, 2015 at 4:27 PM, Vadim A. Misbakh-Soloviov wrote: > ``` > # Hostnames completion. > zstyle -e ':completion:*:hosts' hosts 'reply=( > ${${${${${(f)"$(<${HOME}/.ssh/known_hosts)"//\[/}//\]:/ }:#[\|]*}%%\ > *}%%,*} > ${${${(@M)${(f)"$(<${HOME}/.ssh/config)"}:#Host *}#Host }:#*[*?]*} > ${(s: :)${(ps:\t:)${${(f)~~"$( )' > zstyle ':completion:*:*:*:hosts' ignored-patterns 'ip6*' 'localhost*' > > > ``` You'll probably want these lines inside an if test -f ~/.ssh/config, as old versions of zsh will abort execution if $(< fails to find the file. (This bit me once a few years ago). -- Mikael Magnusson