From: Sergey Matveev Date: Tue, 22 Jun 2021 07:40:14 +0000 (+0300) Subject: Let's try bfs X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=034ee63ce9336b2b5c7a4991538e6a7d51a781a0 Let's try bfs --- diff --git a/bin/bin/tmux-fzf.zsh b/bin/bin/tmux-fzf.zsh index eb66b31..bdf316c 100755 --- a/bin/bin/tmux-fzf.zsh +++ b/bin/bin/tmux-fzf.zsh @@ -7,7 +7,9 @@ trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT case $1 in (find) - find . -mindepth 1 -path "*/.git" -prune -o \ + bfs . -mindepth 1 \ + -path "*/.git" -prune -o \ + -path "*/.redo" -prune -o \ \( -type f -o -type d -o -type l \) -print | cut -c3- | fzf -m --preview="less -N -S {}" | while read fn ; do print ${(q)fn} ; done > $tmp diff --git a/zsh/.zshrc b/zsh/.zshrc index a3ea229..ebfebf4 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -82,7 +82,7 @@ alias -g W="| wc -l | sed 's/ //g'" alias mc="mc --nomouse" f() { - find . -name "*$1*" -print + bfs . -name "*$1*" -print } alias ssh="TERM=xterm ssh" @@ -200,8 +200,11 @@ ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan" # fzf {{{ cf() { - local dir=$(find -L ${1:-.} -mindepth 1 -path "*/\.git" -prune -o -type d -print | - fzf --height 40% --reverse --preview="tree -CN {}") + local dir=$(bfs -L ${1:-.} -mindepth 1 \ + -path "*/\.git" -prune -o \ + -path "*/\.redo" -prune -o \ + -type d -print 2>/dev/null | + fzf --height 40% --reverse --preview="tree -CN {}") [[ -z $dir ]] || { print -s cd $dir ; cd $dir } } # }}}