2015-04-18 05:21:23 +02:00
|
|
|
if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then
|
|
|
|
local height
|
|
|
|
height=${FZF_TMUX_HEIGHT:-40%}
|
|
|
|
if [[ $height =~ %$ ]]; then
|
|
|
|
height="-p ${height%\%}"
|
2015-04-17 23:44:53 +02:00
|
|
|
else
|
2015-04-18 05:21:23 +02:00
|
|
|
height="-l $height"
|
2015-04-17 23:44:53 +02:00
|
|
|
fi
|
2015-04-18 05:21:23 +02:00
|
|
|
tmux split-window $height "cd $(printf %q "$PWD"); zsh -c 'tmux send-keys -t $TMUX_PANE \"\$(fzf-fsel)\"'"
|
|
|
|
else
|
|
|
|
LBUFFER="${LBUFFER}$(fzf-fsel)"
|
|
|
|
zle redisplay
|
|
|
|
fi
|