+ split_man

This commit is contained in:
Jeffrey Serio 2023-01-18 09:48:37 -06:00
parent 23916be066
commit 0b91239209
3 changed files with 21 additions and 8 deletions

21
split_man Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Check if gum is available
if ! test -x "$(command -v gum)"; then
echo "Missing dependency: gum"
echo "See https://github.com/charmbracelet/gum"
exit 1
fi
CMD=$(gum input --placeholder="command")
if [[ -n "$BYOBU_BACKEND" && "$BYOBU_BACKEND" = "tmux" ]]; then
byobu-tmux split-window -h man "$CMD"
elif [[ -n "$TMUX" ]]; then
tmux split-window -h man "$CMD"
elif [[ -n "$ZELLIJ" ]]; then
zellij action new-pane -- man "$CMD"
else
echo "No byobu, tmux, or Zellij sessions detected"
exit 1
fi

4
tman
View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
CMD=$(gum input --placeholder="command")
tmux split-window -h man "$CMD"

4
zman
View File

@ -1,4 +0,0 @@
#!/usr/bin/env zsh
CMD=$(gum input --placeholder="command")
zellij action new-pane -- man "$CMD"