diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2021-01-03 00:46:34 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2021-01-03 00:48:40 +0900 |
commit | 37708ad9cd5d6f37cee63a1ee1a8308f60283c3d (patch) | |
tree | bc07953aaf4b218b97fe3decaa0b1c6ce65e34de | |
parent | 090dee857f1e81f26df6a1b022130d46f3c656fb (diff) |
Revert "[zsh] Use shell redirection (#2281)"
This reverts commit e9bc7331bde238e84f24b76ebb1f5e18799b15c4.
The change is no longer necessary since 090dee8.
-rw-r--r-- | shell/key-bindings.zsh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index 56e66358..4ae114b2 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -83,7 +83,7 @@ fzf-cd-widget() { local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ -o -type d -print 2> /dev/null | cut -b3-"}" setopt localoptions pipefail no_aliases 2> /dev/null - local dir="$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m < <(eval "$cmd") )" + local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)" if [[ -z "$dir" ]]; then zle redisplay return 0 @@ -107,10 +107,8 @@ bindkey '\ec' fzf-cd-widget fzf-history-widget() { local selected num setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null - selected=( $( - FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd) < <( - fc -rl 1 | perl -ne 'print if !$seen{(/^\s*[0-9]+\**\s+(.*)/, $1)}++' - ) ) ) + selected=( $(fc -rl 1 | perl -ne 'print if !$seen{(/^\s*[0-9]+\**\s+(.*)/, $1)}++' | + FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) ) local ret=$? if [ -n "$selected" ]; then num=$selected[1] |