]> Sergey Matveev's repositories - dotfiles.git/blobdiff - zsh/.zshrc
Single tmux popup for fzf
[dotfiles.git] / zsh / .zshrc
index e5f02abe87c2c2666e9ab84a04dc6b6b09c38874..387f852f7dca9ef012c07f50bc9079a5e2054db1 100644 (file)
@@ -5,6 +5,7 @@ setopt INTERACTIVE_COMMENTS
 setopt GLOB_STAR_SHORT GLOB_DOTS EXTENDED_GLOB
 setopt NO_NOMATCH
 setopt AUTO_PUSHD PUSHD_IGNORE_DUPS
+setopt PIPE_FAIL
 
 setopt RM_STAR_SILENT
 export LISTMAX=9999
@@ -210,5 +211,10 @@ ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=cyan"
 # }}}
 
 # fzf {{{
-. ~/work/fzf/shell/key-bindings.zsh
+export FZF_DEFAULT_OPTS="--color=16 --info=inline"
+cf() {
+    local dir=$(find ${1:-.} -path "*/\.git" -prune -o -type d -print |
+        fzf --height 40% --reverse --preview="tree -CN {}")
+    [[ -z "$dir" ]] || cd "$dir"
+}
 # }}}