summaryrefslogtreecommitdiff
path: root/nav
blob: a67ecf2b40f063cd0f9c431264035d05a30f27c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
cat \
  <(echo "edit: enter | prnt: alt-enter | view: alt-0..6 | pgup/pgdn: scroll") \
  <(fd --exclude=_ -t f . $PWD | sed "s,$PWD/*,,g") \
  | fzf \
    --bind "alt-enter:accept" \
    --bind "enter:execute(vim {})" \
    --bind "esc:ignore" \
    --bind "ctrl-/:change-preview-window(90%|hidden|)" \
    --bind "alt-0:change-preview(bat -p --color always {})" \
    --bind "alt-1: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-2:change-preview(git log --color=always {})" \
    --bind "alt-3:change-preview(git log --color=always -p {})" \
    --bind "alt-4:change-preview(git blame -c --date=short {})" \
    --bind "alt-5:change-preview(git log --pretty=short {} | git shortlog -nse)" \
    --bind "alt-6:change-preview(git log --pretty=short {} | git shortlog)" \
    --bind "pgup:preview-page-up" \
    --bind "pgdn:preview-page-down" \
    --bind "backward-eof:abort" \
    --header-lines=1 \
    --header-first \
    --preview-window="border-sharp,88" \
    --preview "bat -p --color always {}"