diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-11-08 00:11:46 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-11-08 00:12:12 +0900 |
commit | e99731ea852d1faac5390594cd980708edf826cf (patch) | |
tree | 91705daf049196425808c621d4676c1111813057 /shell/key-bindings.bash | |
parent | 15659ac6e6ae413d86dc8229c7827e6983bad9db (diff) |
[shell] Add FZF_ALT_C_COMMAND for ALT-C (#408)
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r-- | shell/key-bindings.bash | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 0bfd50d6..e9bea78d 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -1,7 +1,7 @@ # Key bindings # ------------ __fzf_select__() { - local cmd="${FZF_CTRL_T_COMMAND:-"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-"}" @@ -29,9 +29,10 @@ __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- | $(__fzfcmd) +m) && printf 'cd %q' "$dir" + local cmd dir + cmd="${FZF_ALT_C_COMMAND:-"command find -L . \\( -path '*/\\.*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3-"}" + dir=$(eval "$cmd" | $(__fzfcmd) +m) && printf 'cd %q' "$dir" } __fzf_history__() ( |