1 # Copies the path of given directory or file to the system or X Windows clipboard.
2 # Copy current directory if no parameter.
4 # If no argument passed, use current directory
7 # If argument is not an absolute path, prepend $PWD
8 [[ $file = /* ]] || file="$PWD/$file"
10 # Copy the absolute path without resolving symlinks
11 # If clipcopy fails, exit the function with an error
12 print -n "${file:a}" | clipcopy || return 1
14 echo ${(%):-"%B${file:a}%b copied to clipboard."}