diff options
author | Ben Sima <ben@bsima.me> | 2022-02-10 04:50:18 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2022-02-10 04:50:18 -0500 |
commit | 3105cbe35ffb97b03baca0b52b6057f4303fb9bc (patch) | |
tree | b2126bce8e516d8b5d9f38d8af91759516a017a3 /seek | |
parent | 14cd77e3e424c7f393afad6f71687087d107b14e (diff) |
seek / nav improvements
- condensed the headers
- added alt-n for changing previews
- fixed bug in seek
- other conveniences
Diffstat (limited to 'seek')
-rwxr-xr-x | seek | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -1,13 +1,26 @@ #!/usr/bin/env bash set -euo pipefail -RG="rg --ignore-case --files-with-matches $*" -readarray -t selected <<< "$(fzf-tmux \ - -p "70%" \ +RG_DEFAULT_COMMAND="rg --ignore-case --files-with-matches $*" +INITIAL_QUERY="" +readarray -t selected <<< "$(fzf \ --multi \ --exact \ --ansi \ + --disabled \ + --query "$INITIAL_QUERY" \ --bind "ctrl-a:select-all" \ - --bind "change:reload:$RG {q} || true" \ + --bind "alt-0:change-preview:rg --ignore-case --pretty --context 2 {q} {}" \ + --bind "alt-1:change-preview(bat -p --color always {})" \ + --bind "alt-2:change-preview(git log --color=always --date=relative --abbrev-commit --pretty=format:'%Cred%h%Creset %s / %an %Creset%C(yellow)%d%Creset%Cgreen(%cr)%Creset' -- {})" \ + --bind "alt-3:change-preview(git log --color=always {})" \ + --bind "alt-4:change-preview(git log --color=always -p {})" \ + --bind "alt-5:change-preview(git blame -c --date=short {})" \ + --bind "alt-6:change-preview(git log --pretty=short {} | git shortlog -nse)" \ + --bind "alt-7:change-preview(git log --pretty=short {} | git shortlog)" \ + --bind "pgup:preview-page-up" \ + --bind "pgdn:preview-page-down" \ + --bind "backward-eof:abort" \ + --bind "change:reload:$RG_DEFAULT_COMMAND {q} || true" \ --print-query \ --preview "rg --ignore-case --pretty --context 2 {q} {}" \ --preview-window down |