Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: More zsh tricks required please



> On the above BTW is it possible to do a
> 
> > cd =some_script   (doesn't work)
> 
> to jump to the directory??
> 

That works for me, thanks to this bit of .zshrc:


# cd to a file should take you to the dir that contains the file
# courtesy of Artur Penttinen <artur@xxxxxxxxxxx>
function cd () {
  if [[ -f $1 ]]; then
    builtin cd $1:h
  else
    builtin cd $1
  fi
}



Messages sorted by: Reverse Date, Date, Thread, Author