mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-16 02:07:06 +00:00
Merge pull request #35 from junegunn/fix-tmux-on-linux
Fix #34: tmux integration on Linux
This commit is contained in:
commit
d83febea46
16
install
16
install
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user