From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25490 invoked by alias); 8 Apr 2015 16:47:49 -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: 20111 Received: (qmail 3572 invoked from network); 8 Apr 2015 16:47:47 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=kK4Pr/hEKBuQgmQnNnkZMw+Ty/keFt2gG8W3OME62/g=; b=MAUFnPzDIIWEyrvV8wAnKfQQpW4yXA8ZsSkh28xYdE7IDSwA2sQkX2tqtjNJ/8yu0b o4YXkGwYI64IZH3lGYCq7oiggkJ4vuO5vLwH8NvyEIu1SaorTJgUpLSnV6aW4V6YFI2V CgKrb0Ka8osKjXyLqRS+2EMOV/ftcifbSeWuQQ5wkg2ME10c5mh/QXGA7a7inlA83puz +x5dllEmMTZi6wh6znZt2BVv63A4tFDtcH/CSuPU2LQcPHNrnJBcKErMD74Iw7pYBMzr A9LXmzEyUm4g4Sbtw45TDkQnpoY/tTAGbqlV1tWFM4tmIcjLmOje54m7ZcCZG6xVJBzl 87gg== X-Gm-Message-State: ALoCoQmPUh9a9deI6qZ1jvKlbppMs52J9weifEfvH2TKqSWf1Rn/rUxx/yUjUwbX2STM2+F3amnS X-Received: by 10.182.20.237 with SMTP id q13mr32921854obe.82.1428511649900; Wed, 08 Apr 2015 09:47:29 -0700 (PDT) From: Bart Schaefer Message-Id: <150408094726.ZM23641@torch.brasslantern.com> Date: Wed, 8 Apr 2015 09:47:26 -0700 In-Reply-To: Comments: In reply to Jesper Nygards "Re: Ssh completion from ~/.ssh/config" (Apr 7, 8:37pm) References: <1797284.9M4pHoONQN@note> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org, zsh-users@zsh.org Subject: Re: Ssh completion from ~/.ssh/config MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.