void-packages/srcpkgs/fzf/files/fzf-file-widget

14 lines
411 B
Plaintext
Raw Normal View History

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
height="-l $height"
2015-04-17 23:44:53 +02:00
fi
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