From 72c9fa386e30272b9dcf8255ea7507d0c8ae143a Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 24 Apr 2023 13:36:00 -0500 Subject: [PATCH] promote tn to a smarter function --- home/private_dot_config/zsh/functions/pmodload | 5 ----- home/private_dot_config/zsh/functions/tn | 9 +++++++++ home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 home/private_dot_config/zsh/functions/pmodload create mode 100644 home/private_dot_config/zsh/functions/tn diff --git a/home/private_dot_config/zsh/functions/pmodload b/home/private_dot_config/zsh/functions/pmodload deleted file mode 100644 index a04c5de..0000000 --- a/home/private_dot_config/zsh/functions/pmodload +++ /dev/null @@ -1,5 +0,0 @@ -# function pmodload { - # if you are using Prezto, you'll need an empty pmodload function -# } - -# vim: ft=zsh sw=2 ts=2 et diff --git a/home/private_dot_config/zsh/functions/tn b/home/private_dot_config/zsh/functions/tn new file mode 100644 index 0000000..61062ff --- /dev/null +++ b/home/private_dot_config/zsh/functions/tn @@ -0,0 +1,9 @@ +#!/usr/bin/env zsh +##? create a new tmux session +##? use current directory name as a fallback + +if [ -z "$1" ]; then + tmux new-session -s "${PWD:A:t2}" +else + tmux new-session -s "$1" +fi diff --git a/home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh b/home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh index 0582d8b..40eede2 100644 --- a/home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh +++ b/home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh @@ -3,6 +3,6 @@ alias t-labbook="$DOTFILES_DIR/tmux/labbook.sh" alias tmux="tmux -f $HOME/.config/tmux/tmux.conf" alias t='tmux' alias ta='tmux attach -t' -alias tn='tmux new-session -s' +# alias tn='tmux new-session -s' alias tl='tmux list-sessions'