On Sat, Dec 05, 2009 at 03:42:58PM +0300, Alexey I. Froloff wrote: > Just need pure-zsh "relative" implementation. Here's my quick'n'dirty code: relate() { local -a what to res what=( ${(ps:/:)"${${${${1//\/\///}//\/.\///}%%/.}%%/}"} ) to=( ${(ps:/:)"${${${${2//\/\///}//\/.\///}%%/.}%%/}"} ) while (( $#what > 0 )) && (( $#to > 0 )) && [[ $what[1] == $to[1] ]]; do what[1]=() to[1]=() done while (( $#to > 0 )); do res+=.. to[1]=() done res=( "$res[@]" "$what[@]" ) echo ${(pj:/:)res} } relate Completion/Unix/Command/_git Functions/ ../Completion/Unix/Command/_git -- Regards, Sir Raorn.