]> Sergey Matveev's repositories - dotfiles.git/blobdiff - zsh/.zsh/functions/cf
Make some functions autoloadable
[dotfiles.git] / zsh / .zsh / functions / cf
diff --git a/zsh/.zsh/functions/cf b/zsh/.zsh/functions/cf
new file mode 100644 (file)
index 0000000..f0ab759
--- /dev/null
@@ -0,0 +1,6 @@
+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 }