summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-02-18 12:17:05 -0500
committerBen Sima <ben@bsima.me>2022-02-18 12:17:05 -0500
commitb1170c6a23c3f38e9444a80e4ef68ae2f46e4ac0 (patch)
tree73e16980d1d0c7f313cc94ac8b8a64707a614580
parent11b995a491978ad899e0555ceea7e20f10822766 (diff)
Refactor ns, add more views
-rwxr-xr-xBiz/Ide/ns28
1 files changed, 15 insertions, 13 deletions
diff --git a/Biz/Ide/ns b/Biz/Ide/ns
index cc299c7..8ca8d98 100755
--- a/Biz/Ide/ns
+++ b/Biz/Ide/ns
@@ -1,24 +1,26 @@
-cat \
- <(echo "ship: ctrl-space") \
- <(echo "lint: alt-l") \
- <(echo "test: alt-t") \
- <(echo "bild: alt-space") \
- <(echo "edit: alt-enter") \
- <(echo "repl: enter") \
- <(fd --exclude=_ -t f . $BIZ_ROOT | sed "s,$BIZ_ROOT/*,,g") \
- | fzf-tmux \
+#!/usr/bin/env bash
+set -euo pipefail
+fd --exclude=_ -t f . $BIZ_ROOT | sed "s,$BIZ_ROOT/*,,g" \
+ | fzf \
--bind "alt-space:execute(bild {} && read -p [fin])" \
--bind "alt-enter:execute(vim {})" \
--bind "alt-l:execute(lint {} && read -p [fin])" \
--bind "enter:execute(repl {})" \
--bind "ctrl-space:execute(ship {} && read -p [fin])" \
--bind "alt-t:execute(bild {} && run {} test && read -p [fin])" \
- --bind "ctrl-/:change-preview-window(88|hidden|)" \
- --bind "alt-0:change-preview(cat {})" \
+ --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 "backward-eof:abort" \
--bind "pgup:preview-page-up" \
--bind "pgdn:preview-page-down" \
- --header-lines=6 \
+ --header="repl: enter | edit: alt-enter | bild: alt-space | test: alt-t | lint: alt-l | ship: ctrl-space" \
--header-first \
--preview-window="border-sharp,88" \
- --preview "cat {}"
+ --preview "bat -p --color=always {}"
+###