diff options
author | Ben Sima <ben@bsima.me> | 2022-02-09 17:06:44 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-02-09 17:06:44 -0500 |
commit | 538a79edfb0e80fd3b686aabf16cd5ed57febcab (patch) | |
tree | 8d6277f67cfb35b923eb0e43238bb346d7223bf7 | |
parent | 06407aba3fc1cc562c58cf4f681af3d0db80402e (diff) |
seek: use fzf-tmux, popup, $EDITOR, and print files when done
The printing is important because I often want to know what I just edited, and I forget.
-rwxr-xr-x | seek | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -1,8 +1,8 @@ #!/usr/bin/env bash set -euo pipefail -RG_DEFAULT_COMMAND="rg --ignore-case --files-with-matches" -export FZF_DEFAULT_COMMAND="rg --files" -readarray -t selected <<< "$(fzf \ +RG_DEFAULT_COMMAND="rg --ignore-case --files-with-matches $*" +readarray -t selected <<< "$(fzf-tmux \ + -p "70%" \ --multi \ --exact \ --ansi \ @@ -14,4 +14,12 @@ readarray -t selected <<< "$(fzf \ )" query=${selected[0]} files=("${selected[@]:1}") -edit "+/$query" "${files[@]}" +if [[ -n "${files:-}" ]] +then + # i don't think this works with emacs... + ${EDITOR:-vim} "+/$query" "${files[@]}" + for f in "${files[@]}" + do + echo "$f" + done +fi |