From 61fddc19c5ab9d374dd4246c15e6aedccf807ced Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 5 Oct 2016 00:21:46 +0900 Subject: [PATCH] fe --- Examples.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Examples.md b/Examples.md index 15b160d..473d948 100644 --- a/Examples.md +++ b/Examples.md @@ -7,11 +7,9 @@ You can replace `fzf` command on each example with [`fzf-tmux`](https://github.c # - Bypass fuzzy finder if there's only one match (--select-1) # - Exit if there's no match (--exit-0) fe() { - IFS=' -' - local declare files=($(fzf-tmux --query="$1" --select-1 --exit-0)) + local files + IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0)) [[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}" - unset IFS } # Modified version where you can press @@ -19,7 +17,7 @@ fe() { # - CTRL-E or Enter key to open with the $EDITOR fo() { local out file key - out=$(fzf-tmux --query="$1" --exit-0 --expect=ctrl-o,ctrl-e) + IFS=$'\n' out=($(fzf-tmux --query="$1" --exit-0 --expect=ctrl-o,ctrl-e)) key=$(head -1 <<< "$out") file=$(head -2 <<< "$out" | tail -1) if [ -n "$file" ]; then