# Prefix and Basic Keybindings
unbind C-b # Unbind the default prefix (Control-B)
set -g prefix C-a # Set new prefix to Control-A
bind C-a send-prefix # Bind Control-Space to send the prefix key
bind -n M-h previous-window # Bind Alt-H to select the previous window
bind -n M-l next-window # Bind Alt-L to select the next window
bind - split-window -v -c "#{pane_current_path}" # Vertical split using current pane path
bind \\ split-window -h -c "#{pane_current_path}" # Horizontal split using current pane path
bind-key x kill-pane # Bind 'x' to kill the current pane
# Copy Mode Keybindings (Vi Mode)
set-window-option -g mode-keys vi # Use Vi keybindings in copy mode
bind-key -T copy-mode-vi v send-keys -X begin-selection # Begin selection in copy mode
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle # Toggle rectangle selection in copy mode
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel # Copy selection and cancel in copy mode
# General Session settings
set -g base-index 1 # Start windows numbering from 1
set -g pane-base-index 1 # Start panes numbering from 1
set -g renumber-windows on # Renumber windows sequentially when one is closed
set -g history-limit 1000000 # Increase the scrollback history buffer size
set -g detach-on-destroy off # Keep tmux server running even when all sessions are closed
set -g focus-events on # Enable forwarding of focus events to applications
set -g allow-passthrough on # Enable allow-passthrough for terminal capabilities
set-hook -g window-linked 'rename-window " "' # Automatically name new windows
# User Interface and Interaction
set -g status-interval 5 # Status line update interval
set -g status-position top # Position of the status line
set -g @t-fzf-prompt ' ' # Custom prompt for fzf integration
set -g mouse on # Enable mouse control (clickable windows, panes, resize panes)
set -g visual-activity on # Provide visual feedback when activity occurs in a window
setw -g monitor-activity on # Monitor activity in other windows
set -g set-clipboard on # Synchronize tmux buffer with system clipboard
# Terminal behavior
set -s escape-time 0 # Reduce time waiting for escape sequence completion to 0ms
set-option -sa terminal-overrides ",xterm*:Tc" # Append terminal capabilities for true color support
# Setting up environment variables for the CS50 library
set-environment -g LIBRARY_PATH "~/cs50lib"
set-environment -g C_INCLUDE_PATH "~/cs50lib"
set-environment -g LD_LIBRARY_PATH "~/cs50lib"
set-environment -g DYLD_LIBRARY_PATH "~/cs50lib"
# Tmux Plugin Manager (TPM) and Plugins
set -g @plugin 'tmux-plugins/tpm' # TPM base plugin
set -g @plugin 'tmux-plugins/tmux-sensible' # Sensible default settings for tmux
set -g @plugin 'christoomey/vim-tmux-navigator' # Seamless navigation between tmux panes and vim splits
set -g @plugin 'tmux-plugins/tmux-yank' # Tmux clipboard integration
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name' # Window names with Nerd Fonts support
set -g @plugin 'dracula/tmux' # Dracula theme for tmux
set -g @plugin 'omerxx/tmux-sessionx' # Session management enhancements
set -g @plugin 'kenos1/tmux-cht-sh' # Integration with cheat.sh
# set -g @plugin 'dreamsofcode-io/catppuccin-tmux' # Catppuccin theme (commented out)
# SessionX Configuration =======================================================
# Key Bindings
set -g @sessionx-bind 'o' # Set the key binding to invoke SessionX
# Session Paths
set -g @sessionx-x-path '~/.dotfiles' # e.g. set -g @sessionx-x-path '~/dotfiles'
set -g @sessionx-custom-paths '~/Developer/AdventOfCode,~/Documents/University/UM/College_Code' # Custom paths for quick session creation
# Session Visibility
set -g @sessionx-filter-current 'false' # Include the current session in the list by default
# Window and Layout Options
set -g @sessionx-window-mode 'off' # Start with session view, not window view
# UI Customization for Preview
set -g @sessionx-preview-location 'top' # Set preview location
set -g @sessionx-preview-ratio '70%' # Set preview size ratio
set -g @sessionx-window-height '90%' # Set window height
set -g @sessionx-window-width '75%' # Set window width
# SessionX CONFIGURATION END ===================================================
# Dracula Theme Configuration ==================================================
# General Appearance
set -g @dracula-show-powerline true # Enable the powerline style
set -g @dracula-show-left-icon session # Set the left icon to represent sessions
# Weather Plugin Configuration
set -g @dracula-fixed-location "Miami" # Set a fixed location for weather data
set -g @dracula-show-fahrenheit false # Display weather temperatures in Celsius
# Plugin Settings
set -g @dracula-plugins "ram-usage weather" # Enable RAM usage and weather plugins
# UI Toggles
set -g @dracula-show-flags true # Toggle visibility of various flags in the status bar
# Dracula Theme Configuration END ==============================================
# Initialize TPM
run '~/.tmux/plugins/tpm/tpm'