From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13237 invoked by alias); 8 Apr 2015 17:59:59 -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: 20112 Received: (qmail 9755 invoked from network); 8 Apr 2015 17:59: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,HTML_MESSAGE,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 :content-type; bh=zqgAtpHOAZqQZHP9a5TeXh37Y6SN7o3h7OcYnGWHSIQ=; b=DVeJTlHj9msGbgKxD3dhgfj9YZT7NKYSpoVvsP4Ty4cdXgR9zCHjfTGfqaBLz9rAlR vMJKltYSexHdUdw2oPhp7rNo7JcN8nUOkEsW4tEQFqShLWL1/e+LMnnSXlht0bZoYrCn QIkAT/YrsWP6qBjC+2698IcjhzERZi+iFBVNLs+EhcQFcWVaJEe9yfq7R0OutRIBL4z1 l0FrBBtVK8Rw5slNE1kFcVTBMW8iYANm2sLbpDqLD6XRN3kQIgGUhZt2ggtKDbMdLUsZ p3ZiRDIBnBLw9pNm+o8KDwA7Q8Ugl+UuPTqgTtF1IdmKAUGY6fPFtFkFAd7BUktKaEOf C9dA== MIME-Version: 1.0 X-Received: by 10.152.22.72 with SMTP id b8mr771934laf.1.1428515978671; Wed, 08 Apr 2015 10:59:38 -0700 (PDT) In-Reply-To: <150408094726.ZM23641@torch.brasslantern.com> References: <1797284.9M4pHoONQN@note> <150408094726.ZM23641@torch.brasslantern.com> Date: Wed, 8 Apr 2015 19:59:38 +0200 Message-ID: Subject: Re: Ssh completion from ~/.ssh/config From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=089e0158b83276fb6005133a4be3 --089e0158b83276fb6005133a4be3 Content-Type: text/plain; charset=UTF-8 Thank you Bart, that works perfectly! On Wed, Apr 8, 2015 at 6:47 PM, Bart Schaefer wrote: > On Apr 7, 8:37pm, Jesper Nygards wrote: > } > } However, the existing _ssh file already has working code for parsing the > } .ssh/config file. Code which is far more readable, and doesn't require me > } to parse it myself with that hosts definition. For some reason though, > } someone has decided that it is not to be used. I would still prefer it if > } there was some way of configuring that I want to use the code that is > } already written, and that I prefer .ssh/config over .ssh/known_hosts. > > Try this: > > zstyle -e ':completion:*:*:ssh:*:my-accounts' users-hosts \ > '[[ -f ~/.ssh/config && $key = hosts ]] && key=my_hosts reply=()' > > You can then either define the function _my_hosts which will be called to > add the host completions, or _ssh_hosts will fall through to the code that > reads the .ssh/config files. > --089e0158b83276fb6005133a4be3--