diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2023-09-19 13:39:57 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-09-19 13:39:57 +0900 |
| commit | 2bed7d370e3ff654542aec0e9ad698dac64f244b (patch) | |
| tree | f70edbc2bb682f92764f5b12484d93b4816bcac1 /shell/key-bindings.zsh | |
| parent | d2b852f7cbd2da53804de00cf22ca0b7e6c9f472 (diff) | |
| download | fzf-2bed7d370e3ff654542aec0e9ad698dac64f244b.tar.gz | |
[shell] Use --scheme=path when appropriate
Without the option, you may get suboptimal results if you have many
paths with spaces in their names.
e.g. https://github.com/junegunn/fzf/issues/2909#issuecomment-1207690770
Close #3433
Diffstat (limited to 'shell/key-bindings.zsh')
| -rw-r--r-- | shell/key-bindings.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index dfb473cc..05110425 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -46,7 +46,7 @@ __fsel() { -o -type l -print 2> /dev/null | cut -b3-"}" setopt localoptions pipefail no_aliases 2> /dev/null local item - eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-}" $(__fzfcmd) -m "$@" | while read item; do + eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --scheme=path --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-}" $(__fzfcmd) -m "$@" | while read item; do echo -n "${(q)item} " done local ret=$? @@ -75,7 +75,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="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-}" $(__fzfcmd) +m)" + local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --scheme=path --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-}" $(__fzfcmd) +m)" if [[ -z "$dir" ]]; then zle redisplay return 0 |
