tmux.conf 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # ==============================================
  2. # === TMUX Configuration ===
  3. # ==============================================
  4. # General Settings
  5. # ----------------
  6. set -g prefix C-a # Use CTRL+a as our tmux command prefix
  7. unbind C-b # Unbind default prefix
  8. set -g base-index 1 # Start windows numbering at 1
  9. setw -g pane-base-index 1 # Start pane numbering at 1
  10. set -g renumber-windows on # Renumber windows when a window is closed
  11. set -s escape-time 1 # Lower the default tmux delay
  12. set -g mouse on # Enable mouse support
  13. setw -g aggressive-resize on # Only resize screen if smaller screen is active
  14. set -g history-limit 10000 # Store 10k lines of history
  15. set-option -g allow-rename off # Disable automatic window renaming
  16. set-option -s set-clipboard on # Enable clipboard support
  17. setw -g mode-keys vi # Use vi keys in copy mode
  18. # Key Bindings
  19. # ------------
  20. bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display "tmux reloaded!" # Reload config
  21. bind v split-window -h -c "#{pane_current_path}" # Split vertically
  22. bind s split-window -v -c "#{pane_current_path}" # Split horizontally
  23. # Vim-like pane navigation
  24. bind h select-pane -L
  25. bind j select-pane -D
  26. bind k select-pane -U
  27. bind l select-pane -R
  28. # Vim-like pane resizing
  29. bind -r H resize-pane -L 5
  30. bind -r J resize-pane -D 5
  31. bind -r K resize-pane -U 5
  32. bind -r L resize-pane -R 5
  33. # Vim-like copy mode navigation
  34. bind-key -T copy-mode-vi h send-keys -X cursor-left
  35. bind-key -T copy-mode-vi j send-keys -X cursor-down
  36. bind-key -T copy-mode-vi k send-keys -X cursor-up
  37. bind-key -T copy-mode-vi l send-keys -X cursor-right
  38. bind-key -T copy-mode-vi w send-keys -X next-word
  39. bind-key -T copy-mode-vi b send-keys -X previous-word
  40. bind-key -T copy-mode-vi 0 send-keys -X start-of-line
  41. bind-key -T copy-mode-vi $ send-keys -X end-of-line
  42. bind-key -T copy-mode-vi G send-keys -X history-bottom
  43. bind-key -T copy-mode-vi g send-keys -X history-top
  44. bind-key -T copy-mode-vi / command-prompt -T search -I "#{pane_current_path}" "send -X search-forward \"%%\""
  45. bind-key -T copy-mode-vi ? command-prompt -T search -I "#{pane_current_path}" "send -X search-backward \"%%\""
  46. bind-key -T copy-mode-vi n send-keys -X search-again
  47. bind-key -T copy-mode-vi N send-keys -X search-reverse
  48. bind-key -T copy-mode-vi v send-keys -X begin-selection
  49. bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
  50. bind-key -T copy-mode-vi Escape send-keys -X cancel
  51. # Move pane to a different window
  52. bind-key m choose-window -F "#{window_index}: #{window_name}" "join-pane -h -t %%"
  53. bind-key M choose-window -F "#{window_index}: #{window_name}" "join-pane -v -t %%"
  54. # Visual Settings
  55. # ---------------
  56. set -g status-interval 2
  57. set-option -g visual-activity off
  58. set-option -g visual-bell off
  59. set-option -g visual-silence off
  60. set-window-option -g monitor-activity off
  61. set-option -g bell-action none
  62. # Terminal Settings
  63. # -----------------
  64. set -gq allow-passthrough on
  65. set -g visual-activity off
  66. set -ga update-environment TERM
  67. set -ga update-environment TERM_PROGRAM
  68. set -g default-terminal "tmux-256color"
  69. set -g terminal-overrides ',xterm-256color:Tc'
  70. # Plugins
  71. # -------
  72. set -g @plugin 'tmux-plugins/tpm'
  73. set -g @plugin 'tmux-plugins/tmux-sensible'
  74. set -g @plugin 'tmux-plugins/tmux-yank'
  75. set -g @plugin 'uhs-robert/tmux-oasis'
  76. set -g @plugin 'tmux-plugins/tmux-battery' # Re-enabled with our fixes
  77. set -g @plugin 'MaximilianGaedig/tmux-filter'
  78. # Plugin Settings
  79. # ---------------
  80. set -g @yank_selection_mouse 'clipboard'
  81. set -g @yank_selection 'clipboard'
  82. set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default
  83. # Oasis Theme Configuration
  84. # -------------------------
  85. set -g status-position top
  86. set -g @oasis_flavor "twilight_dark" # Optional: defaults to lagoon_dark
  87. # Other options: "night", "midnight", "abyss", "starlight", "desert", "sol", "canyon", "dune", "cactus", "mirage", "lagoon", "rose", "dawn"
  88. # Battery module - determine if battery is available
  89. run-shell "if [ -d /sys/class/power_supply/BAT* ]; then \
  90. tmux set -g @battery_available 'yes'; \
  91. fi"
  92. # Battery Icons (Glyphs)
  93. set -g @batt_icon_charge_tier8 ''
  94. set -g @batt_icon_charge_tier7 ''
  95. set -g @batt_icon_charge_tier6 ''
  96. set -g @batt_icon_charge_tier5 ''
  97. set -g @batt_icon_charge_tier4 ''
  98. set -g @batt_icon_charge_tier3 ''
  99. set -g @batt_icon_charge_tier2 ''
  100. set -g @batt_icon_charge_tier1 ''
  101. # Plugin Manager
  102. set-environment -g TMUX_PLUGIN_MANAGER_PATH "$XDG_DATA_HOME/tmux/plugins"
  103. # Install TPM if not already installed
  104. if "test ! -d $XDG_DATA_HOME/tmux/plugins/tpm" \
  105. "run 'git clone https://github.com/tmux-plugins/tpm $XDG_DATA_HOME/tmux/plugins/tpm'"
  106. # Initialize TPM (keep this line at the very bottom of tmux.conf)
  107. run '$XDG_DATA_HOME/tmux/plugins/tpm/tpm'
  108. # Source battery status configuration
  109. # This will be applied after theme loads and on config reload
  110. source-file "$XDG_CONFIG_HOME/tmux/battery_status.conf"