mirror of
https://github.com/junegunn/fzf.git
synced 2026-01-23 19:42:04 +08:00
[shell] Use '-mindepth 1' to omit root folder in 'find' output (#779)
This removes the need for the 'sed' call. Faster, cleaner.
This commit is contained in:
committed by
Junegunn Choi
parent
847c512539
commit
c7b0764002
@@ -1,10 +1,10 @@
|
||||
# Key bindings
|
||||
# ------------
|
||||
__fzf_select__() {
|
||||
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||
-o -type f -print \
|
||||
-o -type d -print \
|
||||
-o -type l -print 2> /dev/null | sed 1d | cut -b3-"}"
|
||||
-o -type l -print 2> /dev/null | cut -b3-"}"
|
||||
eval "$cmd | fzf -m $FZF_CTRL_T_OPTS" | while read -r item; do
|
||||
printf '%q ' "$item"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user