--- /dev/null
+#!/usr/bin/env zsh
+
+cd $2
+set -e
+fpath=(~/.tmux/functions.zsh $fpath)
+autoload tmux-fzf-$1
+tmp=`mktemp`
+trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
+tmux-fzf-$1 > $tmp || { echo unknown command ; sleep 1 ; exit }
+[[ -s $tmp ]] || exit
+tmux set-buffer "`perl -npe 's/\n/ /g' $tmp`"
+tmux paste-buffer
+tmux delete-buffer