]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Let's try bfs
authorSergey Matveev <stargrave@stargrave.org>
Tue, 22 Jun 2021 07:40:14 +0000 (10:40 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 22 Jun 2021 07:40:19 +0000 (10:40 +0300)
bin/bin/tmux-fzf.zsh
zsh/.zshrc

index eb66b31d90a53be5d5d96d7220132f6a38c386f6..bdf316c331383d96c55550682a00653b8369478e 100755 (executable)
@@ -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
index a3ea22949fe45abb8c3f005934d84b4534412645..ebfebf491a52090fc9d1b41ffb1f21526f80fa2b 100644 (file)
@@ -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 }
 }
 # }}}