Use fre instead of pazi. Prioritize directories in git repo if possible

This commit is contained in:
Daniel Lundin 2022-03-04 16:38:38 +01:00
parent d2c2041fa4
commit 18b4e11021

25
.zshrc
View file

@ -49,19 +49,6 @@ setopt null_glob
# ZSH_AUTOSUGGEST_USE_ASYNC=1
# ZSH_AUTOSUGGEST_STRATEGY=(history completion)
## fasd
alias a='fasd -a' # any
alias s='fasd -si' # show / search / select
alias d='fasd -d' # directory
alias f='fasd -f' # file
alias sd='fasd -sid' # interactive directory selection
alias sf='fasd -sif' # interactive file selection
alias z='fasd_cd -d' # cd, same functionality as j in autojump
alias zz='fasd_cd -d -i' # cd with interactive selection
if command -v pazi &>/dev/null; then
eval "$(pazi init zsh)" # or 'bash'
fi
redraw-prompt() {
local precmd
@ -73,11 +60,21 @@ redraw-prompt() {
zle -N redraw-prompt
_jump() {
z --pipe="fzf"
_dir=$((
git rev-parse --show-toplevel 2>/dev/null | xargs -r fd --type d --hidden --follow --exclude .git .
fre --sorted
) | fzf-tmux)
[ -n "$_dir" ] && pushd $_dir >>/dev/null
zle && zle redraw-prompt
}
zle -N _jump
fre_chpwd() {
fre --add "$(pwd)"
}
typeset -gaU chpwd_functions
chpwd_functions+=fre_chpwd
## Keybindings
bindkey -e
bindkey '^[[A' history-beginning-search-backward