summaryrefslogtreecommitdiff
path: root/shell/key-bindings.fish
diff options
context:
space:
mode:
authorPierre Neidhardt <ambrevar@gmail.com>2016-12-24 09:23:07 +0530
committerJunegunn Choi <junegunn.c@gmail.com>2016-12-24 12:53:07 +0900
commitc7b076400297e53b3fdb9bb0605b0c688a39fa40 (patch)
tree2f9d04bf0d70317040ee3ed30019809e3e38186c /shell/key-bindings.fish
parent847c512539f9909ae69a5067c1a64cb9bb485ea3 (diff)
downloadfzf-c7b076400297e53b3fdb9bb0605b0c688a39fa40.tar.gz
[shell] Use '-mindepth 1' to omit root folder in 'find' output (#779)
This removes the need for the 'sed' call. Faster, cleaner.
Diffstat (limited to 'shell/key-bindings.fish')
-rw-r--r--shell/key-bindings.fish4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index b520d8b8..dd75fecf 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -16,10 +16,10 @@ function fzf_key_bindings
# "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not
# $dir itself, even if hidden.
set -q FZF_CTRL_T_COMMAND; or set -l FZF_CTRL_T_COMMAND "
- command find -L \$dir \\( -path \$dir'*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
+ command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-o -type f -print \
-o -type d -print \
- -o -type l -print 2> /dev/null | sed '1d; s#^\./##'"
+ -o -type l -print 2> /dev/null | sed 's#^\./##'"
eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)" -m $FZF_CTRL_T_OPTS" | while read -l r; set result $result $r; end
if [ -z "$result" ]