diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-26 01:00:58 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-26 01:02:44 +0900 |
commit | 938151a834c1858ffdd6091cbcb42688a3784b6b (patch) | |
tree | 6ffbb24708486b37fd92210b830accd1e1ead9d2 /shell/key-bindings.bash | |
parent | 14e3b84073215e29f90f10e6ccce35704598e51d (diff) |
[shell] Add FZF_CTRL_T_COMMAND for CTRL-T
Close #40
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r-- | shell/key-bindings.bash | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index ee79cc35..c04dc440 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -1,10 +1,11 @@ # Key bindings # ------------ __fzf_select__() { - command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + local cmd="${FZF_CTRL_T_COMMAND:-"command \\find -L . \\( -path '*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \ -o -type f -print \ -o -type d -print \ - -o -type l -print 2> /dev/null | sed 1d | cut -b3- | fzf -m | while read item; do + -o -type l -print 2> /dev/null | sed 1d | cut -b3-"}" + eval "$cmd" | fzf -m | while read item; do printf '%q ' "$item" done echo @@ -24,7 +25,7 @@ __fzf_select_tmux__() { else height="-l $height" fi - tmux split-window $height "cd $(printf %q "$PWD");bash -c 'source ~/.fzf.bash; tmux send-keys -t $TMUX_PANE \"\$(__fzf_select__)\"'" + tmux split-window $height "cd $(printf %q "$PWD"); FZF_CTRL_T_COMMAND=$(printf %q "$FZF_CTRL_T_COMMAND") bash -c 'source ~/.fzf.bash; tmux send-keys -t $TMUX_PANE \"\$(__fzf_select__)\"'" } __fzf_cd__() { |