Files
dotfiles/nvim/.config/nvim/snippets/sh.snippets
T
2025-12-09 09:42:08 +01:00

35 lines
755 B
Plaintext

snippet raylibBuildLinux
cc $1.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 -o $1
./$1
snippet window
mkdir -p ${1:[path]}
tmux new-window -t "$SESSION" -c ${1:[path]} -n "${2:[window name]}"
snippet program
tmux send-keys -t "$SESSION":"${1:[window name]}" '${2:[window cmd]}' C-m
snippet session
SESSION="${1:[session name]}"
if tmux has-session -t "$SESSION" 2>/dev/null; then
if [ -n "$TMUX" ]; then
tmux switch-client -t "$SESSION"
else
tmux attach -t "$SESSION"
fi
exit 0
fi
mkdir -p ${2:[path]}
tmux new-session -d -s "$SESSION" -c ${2:[path]} -n "${3:[main window name]}"
$0
tmux select-window -t "$SESSION":"$3"
if [ -n "$TMUX" ]; then
tmux switch-client -t "$SESSION"
else
tmux attach -t "$SESSION"
fi