summaryrefslogtreecommitdiffstatshomepage
path: root/tmux/.local/bin
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2023-07-25 19:29:45 -0500
committerToby Vincent <tobyv@tobyvin.dev>2023-07-25 19:29:45 -0500
commit989d5342f926dd226d68fadbb37a04e82e0a3906 (patch)
treec7da6ca38d1c6f3630ebe2c8372ec9064f7425b4 /tmux/.local/bin
parentd8f552e7e3b0bb63e1955c1b1a556e9a609a48be (diff)
fix(tmux): improve projectr preview
Diffstat (limited to 'tmux/.local/bin')
-rwxr-xr-xtmux/.local/bin/tmux-projectr14
1 files changed, 8 insertions, 6 deletions
diff --git a/tmux/.local/bin/tmux-projectr b/tmux/.local/bin/tmux-projectr
index d32aa9c..2e17a21 100755
--- a/tmux/.local/bin/tmux-projectr
+++ b/tmux/.local/bin/tmux-projectr
@@ -1,16 +1,18 @@
#!/bin/sh
if [ "$#" -eq 0 ]; then
- GIT_PREVIEW='onefetch --include-hidden {}'
- DIR_PREVIEW='tree -CL 3 --gitignore --noreport --filelimit=50 {}'
- PREVIEW_CMD="($GIT_PREVIEW || $DIR_PREVIEW) 2>/dev/null"
+ PREVIEW_CMD='(
+ onefetch --include-hidden --no-art --no-color-palette {}
+ printf "\n"
+ tree -CL 3 --gitignore --noreport --filelimit=50 {}
+ ) 2>/dev/null'
# shellcheck disable=2046
set -- $(
projectr -mgt ~/src ~/pkg ~/dkr ~/doc -P ~/.dotfiles --exclude-cwd |
- fzf-tmux "$FZF_TMUX_OPTS" -- --tac --select-1 --exit-0 -d/ --with-nth 4.. \
- --bind 'focus:transform-header(echo {})' \
- --preview-window='right,75%,<80(hidden)' --preview="$PREVIEW_CMD"
+ fzf-tmux -p100,30 -- --tac --select-1 --exit-0 -d/ --with-nth 4.. \
+ --bind "focus:transform-header(echo {} | sed 's|$HOME|~|')" \
+ --preview-window='right,60,<60(hidden)' --preview="$PREVIEW_CMD"
)
test -n "$1" || exit 0