Skip to content

Instantly share code, notes, and snippets.

@stephenturner
Created April 20, 2022 14:59
Show Gist options
  • Save stephenturner/8f4b16bd044e0c12ee85d9b124546026 to your computer and use it in GitHub Desktop.
Save stephenturner/8f4b16bd044e0c12ee85d9b124546026 to your computer and use it in GitHub Desktop.
stephenturner's ~/.tmux.conf
# Start window and pane indices at 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
# Shift arrow keys to move around panes
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
# Use vim keybindings to select panes
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
# use uppercase vim bindings to resize panes
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r H resize-pane -L 5
bind -r L resize-pane -R 5
# Alt up/down arrow to switch windows
bind -n M-Up previous-window
bind -n M-Down next-window
# Alt number to select a window
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# Status bar styling and content
set -g status-bg black
set -g status-fg white
set -g status-left '#S '
# Highlight the active window in the status bar
set-window-option -g window-status-current-bg yellow
set-window-option -g window-status-current-fg black
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# r key to reload tmux conf
unbind r
bind r source-file ~/.tmux.conf\; display "Reloaded conf."
# Use vi keys to scroll after ctrl-[
setw -g mode-keys vi
# Make active pane borders pop out
set -g pane-border-fg white
set -g pane-active-border-fg cyan
set -g pane-active-border-bg cyan
# Prevents window from automatically renaming
# https://stackoverflow.com/questions/17289439/tmux-window-title-keeps-renaming
set-window-option -g automatic-rename off
set-option -g allow-rename off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment