zsh-users
 help / color / mirror / code / Atom feed
From: Deborah Ariel Pickett <debbiep@mail.csse.monash.edu.au>
To: petre@kgb.ro
Cc: zsh-users@sunsite.dk (ZSH User List)
Subject: Re: [newbie] bash-like feature - autocompletion problem
Date: Thu, 30 Jan 2003 10:02:02 +1100 (EST)	[thread overview]
Message-ID: <200301292302.h0TN22qC003702@bruce.csse.monash.edu.au> (raw)
In-Reply-To: <200301242057.49961.petre@kgb.ro> from "Petre Bandac" at Jan 24, 2003 08:57:49 PM

> I have switched to zsh with the installation of a freebsd workstation @ home; 
> among others, I have the following problem:
> on my linux machine (bash-2.5) I have added one entry in /etc/hosts stating 
> 192.168.0.1 host1 - which helped me when ssh-ing (just typing ssh root@h[TAB] 
> and I got the host1 completed)
> here, using zsh, I tried to do the same, but I get something like:
> [petre@kgb]$ more /etc/hosts | grep cockeru                                   
> 192.168.108.176          cockeru
> [petre@kgb]$ ssh root@coc                                                     
> No matches for: `remote host name', `host', or `corrections'
> I'm using
> [petre@kgb]$ zsh --version                                                    
> zsh 4.0.6 (i386-portbld-freebsd4.7)
> where and what should I modify ?

Here's a little fragment of my .zshrc:

    zstyle ':completion:*' hosts `\
      [[ -f ~/.hosts ]] &&
        sed 's/ .*$//' < ~/.hosts;
      [[ -f ~/.rhosts ]] &&
        sed 's/ .*$//' < ~/.rhosts`

The whole bit between the `...` is just a sed script which grabs
hostnames from various files.  The newer (non-compctl) zsh completion
system seems to make use of a style.  If you don't set that style with a
zstyle command, zsh can't guess what your hosts are.  It seems that zsh
doesn't pick any files by default for a list of hostnames.

I'd say that in your situation you'd want to do something like

    zstyle ':completion:*' hosts `cat /etc/hosts`

(or fancier versions which I'm sure others here will suggest that don't
use cat or sed) in your .zshrc.

Let me know how it goes.

-- 
Debbie Pickett http://www.csse.monash.edu.au/~debbiep debbiep@csse.monash.edu.au
 "Beaujolais goes straight to my head, beaujolais puts me to shame, And I don't
  know why I'm in this place or how I came." - _Beaujolais_, The Alan Parsons
                                    Project


      parent reply	other threads:[~2003-01-29 23:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-24 18:57 Petre Bandac
     [not found] ` <11265.1043664899@finches.logica.co.uk>
     [not found]   ` <200301272332.12295.petre@kgb.ro>
2003-01-29 10:47     ` Oliver Kiddle
2003-01-29 23:02 ` Deborah Ariel Pickett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301292302.h0TN22qC003702@bruce.csse.monash.edu.au \
    --to=debbiep@mail.csse.monash.edu.au \
    --cc=petre@kgb.ro \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).