From 3105cbe35ffb97b03baca0b52b6057f4303fb9bc Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 10 Feb 2022 04:50:18 -0500 Subject: seek / nav improvements - condensed the headers - added alt-n for changing previews - fixed bug in seek - other conveniences --- nav | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'nav') diff --git a/nav b/nav index 7984656..d55ced8 100755 --- a/nav +++ b/nav @@ -1,19 +1,21 @@ cat \ - <(echo "edit: enter") \ - <(echo "prnt: alt-enter") \ - <(echo "prev: alt-0..1") \ - <(echo "pgup: scroll up") \ - <(echo "pgdn: scroll down") \ + <(echo "edit: enter | prnt: alt-enter | view: alt-0..6 | pgup/pgdn: scroll") \ <(fd --exclude=_ -t f . $PWD | sed "s,$PWD/*,,g") \ - | fzf-tmux \ + | fzf \ --bind "alt-enter:accept" \ --bind "enter:execute(vim {})" \ --bind "ctrl-/:change-preview-window(88|hidden|)" \ - --bind "alt-0:change-preview(cat {})" \ + --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" \ - --header-lines=5 \ + --bind "backward-eof:abort" \ + --header-lines=1 \ --header-first \ --preview-window="border-sharp,88" \ - --preview "cat {}" + --preview "bat -p --color always {}" -- cgit v1.2.3