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*"



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