Skip to content
Myr

[shell] Use '-mindepth 1' to omit root folder in 'find' output (#779)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This removes the need for the 'sed' call. Faster, cleaner.

authored by Pierre Neidhardt · committed by Junegunn Choi · parent 847c512 · Browse files · 3 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+6 added−6 removed

  • other:+6 added−6 removed

3 files+6 added−6 removed

modified:shell/key-bindings.bash+2 added-2 removed
modified:shell/key-bindings.fish+2 added-2 removed
14 unmodified lines
1516 # "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not17 # $dir itself, even if hidden.18 set -q FZF_CTRL_T_COMMAND; or set -l FZF_CTRL_T_COMMAND "19 command find -L \$dir \\( -path \$dir'*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \19 command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \20 -o -type f -print \21 -o -type d -print \22 -o -type l -print 2> /dev/null | sed '1d; s#^\./##'"22 -o -type l -print 2> /dev/null | sed 's#^\./##'"2324 eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)" -m $FZF_CTRL_T_OPTS" | while read -l r; set result $result $r; end25 if [ -z "$result" ]26 commandline -f repaint
52 unmodified lines
modified:shell/key-bindings.zsh+2 added-2 removed