Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why doesn't cd ignore files when you type say "cd fred*"
- X-seq: zsh-users 6838
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Why doesn't cd ignore files when you type say "cd fred*"
- Date: Thu, 04 Dec 2003 16:47:36 +0000
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <kohusvg6jgqkqqtbc5th8h12b61iomo1gr@xxxxxxx> <4222.1070552274@xxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
On Thu, 04 Dec 2003 15:37:54 +0000, Peter Stephenson <pws@xxxxxxx>
wrote:
>Use a wrapper. It's not 100% accurate in guessing what form of cd you
>are using, but it will work the vast majority of the time.
>
>cd() {
> local -a dirs
> local d
> for d in $*; do
> [[ -d $d ]] && dirs=($dirs $d)
> done
> if (( ${#dirs} == 1 )); then
> builtin cd $dirs
> else
> # Assume it's something like e.g. `cd SOURCE REPLACE'
> builtin cd "$@"
> fi
>}
Yes tasty! ( I've called this cdd and left the builtin cd alone). (is
the keyword function optional?)
But are there any solutions using COMPCTRL?
zzapper
--
vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
Messages sorted by:
Reverse Date,
Date,
Thread,
Author