diff --git a/bin/cptemplate b/bin/cptemplate index a5396a5..ebe863a 100755 --- a/bin/cptemplate +++ b/bin/cptemplate @@ -100,7 +100,7 @@ if ! [[ -d "$DIR" ]]; then fi files="$(find_files "$DIR")" -selected_file="$(run_fzf "$files")" +selected_file="$(fzf --select-1 --exit-0 <<< "$files")" # Check if target exists if [[ -f "$1" && -z "$FORCE_OVERWRITE" ]]; then diff --git a/bin/fedit b/bin/fedit index c0c4050..28f6bfa 100755 --- a/bin/fedit +++ b/bin/fedit @@ -121,7 +121,7 @@ elif [[ -n $NO_IGNORE_VCS ]]; then fi files="$(find_files $DIR "${extra_opts[@]}")" -selected_file="$(run_fzf "$files")" +selected_file="$(fzf --select-1 --exit-0 <<< "$files")" if [[ -w "${selected_file}" ]]; then "$EDITOR" "$selected_file" diff --git a/lib/fzf.sh b/lib/fzf.sh deleted file mode 100644 index bd311d8..0000000 --- a/lib/fzf.sh +++ /dev/null @@ -1,7 +0,0 @@ -## FZF helpers - -FZF_OPTS=('--select-1' '--exit-0') - -run_fzf() { - fzf "${FZF_OPTS[@]}" -- <<<"$@" || return 2 -}