Skip to content
Snippets Groups Projects
Commit d83febea authored by Junegunn Choi's avatar Junegunn Choi
Browse files

Merge pull request #35 from junegunn/fix-tmux-on-linux

Fix #34: tmux integration on Linux
parents af616457 546a3158
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment