Fix #34: tmux integration on Linux

This commit is contained in:
Junegunn Choi 2014-04-01 08:49:49 +00:00
parent af616457e3
commit 546a315884
1 changed files with 6 additions and 10 deletions

16
install
View File

@ -100,7 +100,7 @@ EOF
# ------------
if [[ $- =~ i ]]; then
read -r -d '' __fsel <<'EOF'
__fsel() {
find * -path '*/\.*' -prune \
-o -type f -print \
-o -type d -print \
@ -108,10 +108,6 @@ read -r -d '' __fsel <<'EOF'
printf '%q ' "$item"
done
echo
EOF
__fsel() {
eval "$__fsel"
}
__fsel_tmux() {
@ -122,7 +118,7 @@ __fsel_tmux() {
else
height="-l $height"
fi
tmux split-window $height "tmux send-keys -t $TMUX_PANE \"\$($__fsel)\""
tmux split-window $height "bash -ci 'source ~/.fzf.bash; tmux send-keys -t $TMUX_PANE \"\$(__fsel)\"'"
}
__fcd() {
@ -177,7 +173,7 @@ EOFZF
# Key bindings
# ------------
# CTRL-T - Paste the selected file path(s) into the command line
read -r -d '' __fsel <<'EOF'
__fsel() {
find * -path '*/\.*' -prune \
-o -type f -print \
-o -type d -print \
@ -185,7 +181,7 @@ read -r -d '' __fsel <<'EOF'
printf '%q ' "$item"
done
echo
EOF
}
if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then
fzf-file-widget() {
@ -196,11 +192,11 @@ if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then
else
height="-l $height"
fi
tmux split-window $height "tmux send-keys -t $TMUX_PANE \"\$($__fsel)\""
tmux split-window $height "source ~/.fzf.zsh; tmux send-keys -t $TMUX_PANE \"\$(__fsel)\""
}
else
fzf-file-widget() {
LBUFFER="${LBUFFER%% #}$(eval "$__fsel")"
LBUFFER="${LBUFFER%% #}$(__fsel)"
zle redisplay
}
fi