# Store the current clipboard in CLIPBOARD before every command so it can be
# used in commands.
-preexec () {
+os_darwin_preexec() {
export CLIPBOARD="$(pbpaste)"
}
+# Add the function as preexec hook.
+add-zsh-hook preexec os_darwin_preexec
+
# Initialize CLIPBOARD so it's available for completion directly after
# startup.
CLIPBOARD=""