Skip to content
Myr

[zsh] emulate -L zsh to avoid issues with incompatible options

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Close #858

authored by Junegunn Choi · committed by Junegunn Choi · parent c89ac34 · Browse files · 2 files+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−4 removed

  • other:+7 added−4 removed

2 files+7 added−4 removed

modified:shell/completion.zsh+2 added-2 removed
modified:shell/key-bindings.zsh+5 added-2 removed
25 unmodified lines
26 echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"27}2829fzf-file-widget() {30 emulate -L zsh31 LBUFFER="${LBUFFER}$(__fsel)"32 local ret=$?33 zle redisplay34 typeset -f zle-line-init >/dev/null && zle zle-line-init
3 unmodified lines
38bindkey '^T' fzf-file-widget3940# ALT-C - cd into the selected directory41fzf-cd-widget() {42 emulate -L zsh43 setopt pipefail 2> /dev/null44 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 \45 -o -type d -print 2> /dev/null | cut -b3-"}"43 setopt localoptions pipefail 2> /dev/null46 local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)"47 if [[ -z "$dir" ]]; then48 zle redisplay49 return 0
8 unmodified lines
58bindkey '\ec' fzf-cd-widget5960# CTRL-R - Paste the selected command from history into the command line61fzf-history-widget() {62 emulate -L zsh63 setopt pipefail 2> /dev/null64 local selected num61 setopt localoptions noglobsubst pipefail 2> /dev/null65 selected=( $(fc -l 1 |66 FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS +s --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(q)LBUFFER} +m" $(__fzfcmd)) )67 local ret=$?68 if [ -n "$selected" ]; then
13 unmodified lines