From d369ae86257b118f22495ceaa781e0e5db93003a Mon Sep 17 00:00:00 2001 From: Juni Kim Date: Mon, 30 Jan 2023 20:26:44 -0500 Subject: [PATCH] tmux --- dots/tmux.conf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dots/tmux.conf b/dots/tmux.conf index 0896fde..024ffbb 100644 --- a/dots/tmux.conf +++ b/dots/tmux.conf @@ -11,9 +11,24 @@ bind-key C-a send-prefix bind r source-file ~/.tmux.conf +bind-key X \ + if-shell '[ "$(tmux display -p "#{session_many_attached}")" -gt 0 ]' { + # the session is attached to multiple clients, so we can just switch the client to a different session. + choose-session + } { + # we are the last client attached to this session; kill it. + # we need to use `run-shell` to ensure that the current session number is expanded *before* we switch to the new session. + confirm -p 'Kill #S (y/n)?' { + choose-tree -s { + run-shell 'tmux switch-client -t "%%" \; kill-session -t "#S"' + } + } + } + set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'odedlaz/tmux-onedark-theme' +# set -g @plugin 'odedlaz/tmux-onedark-theme' +set -g @plugin 'catppuccin/tmux' # Other examples: # set -g @plugin 'github_username/plugin_name' @@ -23,3 +38,4 @@ set -g @plugin 'odedlaz/tmux-onedark-theme' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' +#set-window-option -g status-left " #30S "