Last active
April 21, 2026 04:13
-
-
Save eduardoarandah/6ab9a5c58a3fc67ac7f88e31e8a91b59 to your computer and use it in GitHub Desktop.
Tmux configuration to work nicely with vim
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
| # ============================================================================ | |
| # NOTES | |
| # ============================================================================ | |
| # Show help: prefix + ? | |
| # ============================================================================ | |
| # CONFIG MANAGEMENT | |
| # ============================================================================ | |
| # Reload config: F5 ( default: N/A ) | |
| bind F5 source-file ~/.tmux.conf \; display-message "Config reloaded!" | |
| # ============================================================================ | |
| # CORE SETTINGS | |
| # ============================================================================ | |
| # Set Prefix: Alt + a ( default: Ctrl + b ) | |
| set-option -g prefix M-a | |
| # Enable mouse support | |
| set -g mouse on | |
| # Remove escape delay ( vim support ) | |
| set -sg escape-time 0 | |
| # Increase scrollback buffer history | |
| set -g history-limit 10000 | |
| # Enable extended key support | |
| set-option -g xterm-keys on | |
| # Focus events enabled | |
| set-option -g focus-events on | |
| # Rename windows to current folder name | |
| set-window-option -g automatic-rename-format '#{b:pane_current_path}' | |
| # set-window-option -g automatic-rename on | |
| # set-option -g set-titles on | |
| # Terminal colors - uncomment one if needed: | |
| # set -g default-terminal tmux-256color | |
| # set -g default-terminal xterm-256color | |
| # set -g default-terminal screen-256color | |
| # set-option -sa terminal-overrides ',xterm-256color:RGB' | |
| # ============================================================================ | |
| # COPY MODE | |
| # ============================================================================ | |
| # Use Vi key bindings in copy mode | |
| setw -g mode-keys vi | |
| # Enter copy mode: Alt + c ( default: prefix + [ ) | |
| bind -n M-c copy-mode | |
| # Start selection: v ( default: Space ) | |
| bind -T copy-mode-vi v send -X begin-selection | |
| # Copy to clipboard: y ( default: Enter ) | |
| bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" | |
| # ============================================================================ | |
| # PANES | |
| # ============================================================================ | |
| # Split horizontal (side-by-side): Alt + v ( default: prefix + % ) | |
| bind -n M-v split-window -h -c "#{pane_current_path}" | |
| # Split vertical (top-bottom): Alt + s ( default: prefix + " ) | |
| bind -n M-s split-window -v -c "#{pane_current_path}" | |
| # Select pane Left: Alt + h ( default: prefix + Left ) | |
| bind -n M-h select-pane -L | |
| # Select pane Down: Alt + j ( default: prefix + Down ) | |
| bind -n M-j select-pane -D | |
| # Select pane Up: Alt + k ( default: prefix + Up ) | |
| bind -n M-k select-pane -U | |
| # Select pane Right: Alt + l ( default: prefix + Right ) | |
| bind -n M-l select-pane -R | |
| # Zoom pane: Alt + z ( default: prefix + z ) | |
| bind -n M-z resize-pane -Z | |
| # Kill pane: Alt + x ( default: prefix + x ) | |
| bind -n M-x kill-pane | |
| # Rotate panes: Alt + r ( default: prefix + Ctrl + o ) | |
| bind -n M-r rotate-window | |
| # ============================================================================ | |
| # WINDOWS | |
| # ============================================================================ | |
| # Start window numbering at 1 | |
| set -g base-index 1 | |
| setw -g pane-base-index 1 | |
| # Renumber windows when one is closed | |
| set-option -g renumber-windows on | |
| # New window: Alt + t ( default: prefix + c ) | |
| bind -n M-t new-window -c "#{pane_current_path}" | |
| # Rename window: Alt + , ( default: prefix + , ) | |
| bind -n M-, command-prompt "rename-window '%%'" | |
| # Swap window Left: Alt + Left ( default: N/A ) | |
| bind-key -n M-Left swap-window -t -1\; select-window -t -1 | |
| # Swap window Right: Alt + Right ( default: N/A ) | |
| bind-key -n M-Right swap-window -t +1\; select-window -t +1 | |
| # Next window: Alt + n ( default: prefix + n ) | |
| bind -n M-n next-window | |
| # Previous window: Alt + p ( default: prefix + p ) | |
| bind -n M-p previous-window | |
| # Select window 0: Alt + 0 ( default: prefix + 0 ) | |
| bind -n M-0 select-window -t 0 | |
| # Select window 1: Alt + 1 ( default: prefix + 1 ) | |
| bind -n M-1 select-window -t 1 | |
| # Select window 2: Alt + 2 ( default: prefix + 2 ) | |
| bind -n M-2 select-window -t 2 | |
| # Select window 3: Alt + 3 ( default: prefix + 3 ) | |
| bind -n M-3 select-window -t 3 | |
| # Select window 4: Alt + 4 ( default: prefix + 4 ) | |
| bind -n M-4 select-window -t 4 | |
| # Select window 5: Alt + 5 ( default: prefix + 5 ) | |
| bind -n M-5 select-window -t 5 | |
| # Select window 6: Alt + 6 ( default: prefix + 6 ) | |
| bind -n M-6 select-window -t 6 | |
| # Select window 7: Alt + 7 ( default: prefix + 7 ) | |
| bind -n M-7 select-window -t 7 | |
| # Select window 8: Alt + 8 ( default: prefix + 8 ) | |
| bind -n M-8 select-window -t 8 | |
| # Select window 9: Alt + 9 ( default: prefix + 9 ) | |
| bind -n M-9 select-window -t 9 | |
| # ============================================================================ | |
| # SESSIONS | |
| # ============================================================================ | |
| # Rename session: Alt + 4 ( default: prefix + $ ) | |
| # NOTE: This conflicts with 'Select window 4' above. One will override the other. | |
| # bind -n M-4 command-prompt -I "#{session_name}" "rename-session '%%'" | |
| # Detach session: Alt + d ( default: prefix + d ) | |
| bind -n M-d detach | |
| # Session/Window tree: Alt + w ( default: prefix + w ) | |
| bind -n M-w choose-tree -Zw | |
| # Activity | |
| set -g visual-activity off | |
| set -g visual-bell off | |
| set -g visual-silence off | |
| setw -g monitor-activity off # highlight windows with activity | |
| set -g bell-action none | |
| # DESIGN TWEAKS | |
| # Cyberdream colors | |
| #16181a bg | |
| #1e2124 bg_alt | |
| #3c4048 bg_highlight | |
| #ffffff fg | |
| #7b8496 grey | |
| #5ea1ff blue | |
| #5eff6c green | |
| #5ef1ff cyan | |
| #ff6e5e red | |
| #f1ff5e yellow | |
| #ff5ef1 magenta | |
| #ff5ea0 pink | |
| #ffbd5e orange | |
| #bd5eff purple | |
| ################################## | |
| # windows | |
| ################################## | |
| setw -g window-status-style 'fg=#5eff6c bg=#3c4048' | |
| setw -g window-status-format ' #I) #[fg=#ffffff]#W #[fg=#f1ff5e]#F ' | |
| setw -g window-status-bell-style 'fg=#16181a bg=#ff6e5e' | |
| # current window | |
| setw -g window-status-current-style 'fg=#16181a bg=#f1ff5e' | |
| setw -g window-status-current-format ' #I) #W #F ' | |
| ################################## | |
| # panes | |
| ################################## | |
| set -g pane-border-style 'fg=#ffffff' | |
| set -g pane-active-border-style 'fg=#f1ff5e' | |
| ################################## | |
| # statusbar | |
| ################################## | |
| set -g status-position bottom | |
| set -g status-justify left | |
| set -g status-style 'bg=#3c4048' | |
| # statusbar left | |
| set -g status-left-style 'fg=white bg=#3c4048' | |
| set -g status-left ' [ Session: #S ] ' | |
| set -g status-left-length 50 | |
| # statusbar right | |
| set -g status-right-style 'fg=white bg=#3c4048' | |
| set -g status-right ' %Y-%m-%d %H:%M ' | |
| set -g status-right-length 50 | |
| # messages | |
| set -g message-style 'fg=#16181a bg=#f1ff5e' | |
| # copy mode | |
| setw -g mode-style 'fg=#16181a bg=#f1ff5e' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment