Last active
November 6, 2025 12:58
-
-
Save peterk87/266169bc53f3853499b3 to your computer and use it in GitHub Desktop.
My personal .tmux.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################################################################### | |
| # tmux.conf # | |
| ####################################################################### | |
| ####################################################################### | |
| # Setting the prefix from C-b to C-a # | |
| ####################################################################### | |
| set -g prefix 'C-a' | |
| ####################################################################### | |
| # Free the original Ctrl-b prefix keybinding # | |
| ####################################################################### | |
| unbind C-b | |
| ####################################################################### | |
| # Setting the delay between prefix and command # | |
| ####################################################################### | |
| set -s escape-time 1 | |
| ####################################################################### | |
| # Ensure that we can send Ctrl-A to other apps # | |
| ####################################################################### | |
| bind C-a send-prefix | |
| ####################################################################### | |
| # Set the base index for windows to 1 instead of 0 # | |
| ####################################################################### | |
| set -g base-index 1 | |
| ####################################################################### | |
| # Set the base index for panes to 1 instead of 0 # | |
| ####################################################################### | |
| setw -g pane-base-index 1 | |
| ####################################################################### | |
| # Reload the file with Prefix r # | |
| ####################################################################### | |
| bind r source-file ~/.tmux.conf \; display "Reloaded!" | |
| ####################################################################### | |
| # Pane creation/splitting # | |
| ####################################################################### | |
| bind | split-window -h -c "#{pane_current_path}" | |
| bind - split-window -v -c "#{pane_current_path}" | |
| bind c new-window -c "#{pane_current_path}" | |
| ####################################################################### | |
| # Pane Navigation # | |
| ####################################################################### | |
| bind h select-pane -L | |
| bind j select-pane -D | |
| bind k select-pane -U | |
| bind l select-pane -R | |
| ####################################################################### | |
| # Quick pane selection # | |
| ####################################################################### | |
| bind -r C-h select-window -t :- | |
| bind -r C-l select-window -t :+ | |
| ####################################################################### | |
| # Pane resizing # | |
| ####################################################################### | |
| bind -r H resize-pane -L 5 | |
| bind -r J resize-pane -D 5 | |
| bind -r K resize-pane -U 5 | |
| bind -r L resize-pane -R 5 | |
| ####################################################################### | |
| # Pane Movement # | |
| ####################################################################### | |
| bind-key C-j command-prompt -p "join pane from:" "join-pane -s '%%'" | |
| bind-key C-s command-prompt -p "send pane to:" "join-pane -t '%%'" | |
| ####################################################################### | |
| # Set the default terminal mode to 256color mode # | |
| ####################################################################### | |
| set -g default-terminal "screen-256color" | |
| set -as terminal-features \",*:RGB\" | |
| ####################################################################### | |
| # Enable activity alerts # | |
| ####################################################################### | |
| setw -g monitor-activity on | |
| set -g visual-activity on | |
| ####################################################################### | |
| # Working ctrl+left/right in tmux on ubuntu # | |
| ####################################################################### | |
| #set-window-option -g xterm-keys on | |
| ####################################################################### | |
| # VI mode for tmux # | |
| ####################################################################### | |
| setw -g mode-keys vi | |
| set-option -g status-keys vi | |
| set-option -g bell-action any | |
| set-option -g set-titles on | |
| set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not) | |
| set-option -g visual-bell off | |
| set -g history-limit 100000 | |
| ####################################################################### | |
| # Status bar format and style # | |
| ####################################################################### | |
| set -g status-interval 5 | |
| set -g status-fg white | |
| set -g status-bg colour235 | |
| set -g status-left '' | |
| set -g status-right-length 60 | |
| set -g status-right '#[fg=green,bg=default]#(echo $USER) #[fg=white,bg=default]%l:%M:%S %p#[default] #[fg=yellow]%a %Y-%m-%d' | |
| ####################################################################### | |
| # Status bar tabs # | |
| ####################################################################### | |
| setw -g window-status-format "#[fg=white]#[bg=colour237] #I #[bg=colour237]#[fg=white] #W " | |
| setw -g window-status-current-format "#[bg=blue]#[fg=white,bold] *#I #[fg=white,bold]#[bg=blue] [#W] " | |
| # Bind 'y' to copy the selection and stay in copy mode | |
| bind-key -T copy-mode-vi y send -X copy-selection | |
| # Bind 'Y' to copy the entire line and stay in copy mode | |
| bind-key -T copy-mode-vi Y send -X copy-line | |
| set -g mouse on | |
| # Prevent mouse release from exiting copy mode and clear selection after copy | |
| bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-no-clear | |
| set -g default-shell /bin/zsh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment