void-packages/srcpkgs/fzf/files/fzf-fsel

13 lines
525 B
Plaintext
Raw Normal View History

2015-04-18 05:28:03 +02:00
#!/bin/bash
2015-06-06 22:50:58 +02:00
__fzfcmd() {
[ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
command find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type f -print \
-o -type d -print \
2015-06-06 22:50:58 +02:00
-o -type l -print 2> /dev/null | sed 1d | cut -b3- | $(__fzfcmd) -m | while read item; do
printf '%q ' "$item"
done
echo