Skip to content

Instantly share code, notes, and snippets.

@miguelgrinberg
Last active March 15, 2022 11:39
Show Gist options
  • Save miguelgrinberg/19f7b1d74ae33fd622e080d43dc03ea8 to your computer and use it in GitHub Desktop.
Save miguelgrinberg/19f7b1d74ae33fd622e080d43dc03ea8 to your computer and use it in GitHub Desktop.
My .tmux.conf file for working with tmux
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
# use 256 color terminal
set -g default-terminal "xterm-256color"
# xterm keys
set-window-option -g xterm-keys on
# mouse support
set -g mouse on
# New window: c
unbind c
bind c new-window -c "#{pane_current_path}"
# Detach: d
unbind d
bind d detach
# Next window: n
unbind n
bind n next-window
# Previous window: p
unbind p
bind p previous-window
# Last window: ^A
unbind ^A
bind ^A last-window
# Kill window: k
unbind k
bind k confirm-before "kill-window"
# Redisplay: l
unbind l
bind l refresh-client
# More straight forward key bindings for splitting: | and -
unbind %
unbind |
bind | split-window -h -c "#{pane_current_path}"
unbind '"'
unbind -
bind - split-window -v -c "#{pane_current_path}"
# History
set -g history-limit 10000
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string 'tmux [#S]:#I.#P #W'
# Status bar
set -g status-bg black
set -g status-fg white
set -g status-interval 30
set -g status-left '#[fg=white][#S]#[default] '
set -g status-right ''
# Notifying if other windows have activity
setw -g monitor-activity on
set -g visual-activity on
# Highlighting the active window in status bar
setw -g window-status-current-style bg=red,fg=white
# Reload configuration: r
unbind r
bind r source-file ${HOME}/.tmux.conf \; display-message "tmux.conf reloaded"
@zinglax
Copy link

zinglax commented May 12, 2020

Thanks Miguel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment