zsh:keys: Set sensible fzf args for go-shcwd

Copy arguments from shell/key-bindings.zsh of the fzf repo.
This commit is contained in:
2023-11-20 19:27:17 +01:00
parent 4fceae683f
commit 93467176f6

View File

@@ -202,8 +202,16 @@ bindkey "^M" cmd-on-enter
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(cmd-on-enter)
# Fuzzy PWD selector of all open shells
function shcwd-fzf {
shcwd \
| grep -vFx "$PWD" \
| FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse
--bind=ctrl-z:ignore $FZF_DEFAULT_OPTS" \
$(__fzfcmd) +m
}
function go-shcwd {
dir="$(shcwd | grep -vFx "$PWD" | fzf)"
dir="$(shcwd-fzf)"
[[ -z $dir ]] || pushd -q "$dir"
redraw-prompt
}