summaryrefslogtreecommitdiff
path: root/shell/key-bindings.zsh
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-03-03 18:57:22 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-03-03 18:57:22 +0900
commit05fdf91fc5645018b2100917fa0be8d486e2ce39 (patch)
treeb9f332be3f9f854661f6794aeaa808cfccb4a697 /shell/key-bindings.zsh
parentc387689d1cd45f0d8eb122fe95ee72ccc61d3bff (diff)
downloadfzf-05fdf91fc5645018b2100917fa0be8d486e2ce39.tar.gz
Revert "[zsh] emulate -L zsh to avoid issues with incompatible options"
This reverts commit 3a6af27586c65bb9243c5af7c43a40619503db52.
Diffstat (limited to 'shell/key-bindings.zsh')
-rw-r--r--shell/key-bindings.zsh7
1 files changed, 2 insertions, 5 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index e67e3a78..230c812c 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -27,7 +27,6 @@ __fzfcmd() {
}
fzf-file-widget() {
- emulate -L zsh
LBUFFER="${LBUFFER}$(__fsel)"
local ret=$?
zle redisplay
@@ -39,10 +38,9 @@ bindkey '^T' fzf-file-widget
# ALT-C - cd into the selected directory
fzf-cd-widget() {
- emulate -L zsh
- setopt pipefail 2> /dev/null
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 2> /dev/null
local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)"
if [[ -z "$dir" ]]; then
zle redisplay
@@ -59,9 +57,8 @@ bindkey '\ec' fzf-cd-widget
# CTRL-R - Paste the selected command from history into the command line
fzf-history-widget() {
- emulate -L zsh
- setopt pipefail 2> /dev/null
local selected num
+ setopt localoptions noglobsubst pipefail 2> /dev/null
selected=( $(fc -l 1 |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS --tac -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(q)LBUFFER} +m" $(__fzfcmd)) )
local ret=$?