From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15514 invoked from network); 26 Jul 2001 23:53:37 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 Jul 2001 23:53:37 -0000 Received: (qmail 14 invoked by alias); 26 Jul 2001 23:53:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4054 Received: (qmail 29998 invoked from network); 26 Jul 2001 23:53:07 -0000 Date: Thu, 26 Jul 2001 16:52:46 -0700 From: Will Yardley To: zsh-users@sunsite.dk Subject: comptctl help Message-ID: <20010726165246.D5669@hq.newdream.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.19i Organization: New Dream Network i was wondering if someone could give me a little help with a couple of my compctls. i'd prefer not to use the menu configuration for these - i like having it in a file, and i don't have a recent version of zsh on all of the machines i use. this works great for me, but if i try to cd into a hidden directory (say .ssh / .netscape whatever) it won't autocomplete. presumably i need to add .??*(-/) somehow but i haven't been able to figure out how to do 'or' for this particular expression. i tried adding both separately with -g for each, and i tried putting them between parenthesis with a pipe in between. sorry for the dumb question. here's what i currently have. # cd, rmdir etc. only accept dirs as arguments compctl -g '*(-/)' cd chdir dirs pushd rmdir also, i have this for scp: # for scp or rcp we look for filenames or hostnames filehosts() { local argc argv pref filenames hostnames read -nc argc read -Ac argv pref=$argv[$argc] setopt nullglob filenames=( ${pref}* ) hostnames=( ${(M@)hosts:#${pref}*} ) if [[ ${#filenames} -eq 0 && ${#hostnames} -eq 1 ]]; then reply= else reply=( $filenames $hostnames ) fi return } compctl -K filehosts + -k hosts -S ':' + -u -S '@' \ -x 'n[1,@]' -k hosts -S ':' - 'W[1,*:*]' -f -- rcp scp scp2 this works, but if i'm trying to copy a file that is in a different directory, it completes the directory as if it's a file; ie if i'm trying to copy: junk/rfc2317.txt and i type scp ju it will complete to scp junk[space] instead of junk/ so that i can then tab complete the filename. it also doesn't work so well on older versions of zsh - sometimes it will complete the username wrong or only give me some of the usernames as options. anyway hope someone can help me out on this. will