summaryrefslogtreecommitdiffstats
path: root/shell/key-bindings.fish
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-11-08 00:11:46 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-11-08 00:12:12 +0900
commite99731ea852d1faac5390594cd980708edf826cf (patch)
tree91705daf049196425808c621d4676c1111813057 /shell/key-bindings.fish
parent15659ac6e6ae413d86dc8229c7827e6983bad9db (diff)
[shell] Add FZF_ALT_C_COMMAND for ALT-C (#408)
Diffstat (limited to 'shell/key-bindings.fish')
-rw-r--r--shell/key-bindings.fish6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index a08df3df..3d3c2a72 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -33,9 +33,11 @@ function fzf_key_bindings
end
function __fzf_alt_c
+ set -q FZF_ALT_C_COMMAND; or set -l 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-"
# Fish hangs if the command before pipe redirects (2> /dev/null)
- command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) \
- -prune -o -type d -print 2> /dev/null | sed 1d | cut -b3- | eval (__fzfcmd) +m > $TMPDIR/fzf.result
+ eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)" +m > $TMPDIR/fzf.result"
[ (cat $TMPDIR/fzf.result | wc -l) -gt 0 ]
and cd (cat $TMPDIR/fzf.result)
commandline -f repaint