Commit 00c9203
Changed files (3)
.wraith
scripts
.config/ghostty/config
@@ -20,6 +20,5 @@ shell-integration-features = no-cursor
term = xterm-ghostty
mouse-hide-while-typing = true
-command = /bin/zsh -c "tmux new"
-
+command = /bin/zsh -c "tmux new -s default"
.config/tmux/tmux.conf
@@ -16,7 +16,6 @@ set -g renumber-windows on
set -g escape-time 0
set -g set-clipboard on
set -g status-position top
-set -g default-terminal "${TERM}"
# KEY BINDINGS
unbind C-b
@@ -36,16 +35,20 @@ unbind t
bind t new-window -c "#{pane_current_path}"
bind T clock-mode
+
+
+set -g automatic-rename on
+set -g automatic-rename-format "#(~/.wraith/scripts/tmux-window-name.sh '#{pane_current_command}' '#{pane_current_path}' '#{pane_title}' '#{HOME}')"
+
# Catppuccin theme settings
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_status_background "#1e1e2e"
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_number_position "left"
-set -g @catppuccin_window_default_fill "number"
-set -g @catppuccin_window_default_text " #T"
+set -g @catppuccin_window_text " #W"
set -g @catppuccin_window_current_fill "number"
-set -g @catppuccin_window_current_text " #T"
+set -g @catppuccin_window_current_text " "
set -g @catppuccin_status_left_separator ""
set -g @catppuccin_status_right_separator ""
@@ -60,9 +63,15 @@ set -g @catppuccin_date_time_text " %I:%M %p"
# PLUGINS
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux'
+set -g @plugin 'tmux-plugins/tmux-resurrect'
+# set -g @plugin 'tmux-plugins/tmux-continuum'
+
+set -g @resurrect-strategy-nvim 'session' # Restore neovim sessions
+set -g @resurrect-capture-pane-contents 'on' # Restore pane contents (scrollback)
+set -g @resurrect-save-shell-history 'on' # Save shell history
# Auto install tpm before running
-if "test ! -d ~/.tmux/plugins/tpm" \
+if "test ! -d ~/.config/tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins'"
run '~/.config/tmux/plugins/tpm/tpm'
.wraith/scripts/tmux-window-name.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+COMMAND="$1"
+CURRENT_PATH="$2"
+PANE_TITLE="$3"
+HOME_DIR="$4"
+
+case "$COMMAND" in
+ vim|nvim)
+ TITLE=$(basename "$PANE_TITLE" 2>/dev/null || echo "")
+ if [ -n "$TITLE" ] && [ "$TITLE" != "$COMMAND" ]; then
+ echo "$COMMAND $TITLE"
+ else
+ echo "$COMMAND"
+ fi
+ ;;
+ zsh|bash|fish|sh)
+ # Only show directory name if NOT in home
+ if [ "$CURRENT_PATH" != "$HOME_DIR" ]; then
+ DIR=$(basename "$CURRENT_PATH")
+ echo "$DIR"
+ else
+ echo "home"
+ fi
+ ;;
+ *)
+ echo "$COMMAND"
+ ;;
+esac