summaryrefslogtreecommitdiff
path: root/shell/key-bindings.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-04-22 00:55:39 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-04-22 00:55:39 +0900
commit06b4f7568084358fce6927c3bedc6816159607f0 (patch)
tree881781e6f767022f673c90f5731bb0513897ffb2 /shell/key-bindings.bash
parent318edc8c352250be04a9c2d15f5854084671c3df (diff)
downloadfzf-06b4f7568084358fce6927c3bedc6816159607f0.tar.gz
Fix broken FZF_TMUX switch and update test cases (#203)
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r--shell/key-bindings.bash8
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index dfa9bf6e..362e4428 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -12,6 +12,10 @@ __fzf_select__() {
if [[ $- =~ i ]]; then
+__fzfcmd() {
+ [ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
+}
+
__fzf_select_tmux__() {
local height
height=${FZF_TMUX_HEIGHT:-40%}
@@ -26,11 +30,11 @@ __fzf_select_tmux__() {
__fzf_cd__() {
local dir
dir=$(command find -L ${1:-.} \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
- -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf-tmux -d${FZF_TMUX_HEIGHT:-40%} +m) && printf 'cd %q' "$dir"
+ -o -type d -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) +m) && printf 'cd %q' "$dir"
}
__fzf_history__() {
- HISTTIMEFORMAT= history | fzf-tmux -d${FZF_TMUX_HEIGHT:-40%} +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r | sed "s/ *[0-9]* *//"
+ HISTTIMEFORMAT= history | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r | sed "s/ *[0-9]* *//"
}
__use_tmux=0