Skip to content

Instantly share code, notes, and snippets.

@kwmiebach
Last active May 17, 2026 09:59
Show Gist options
  • Select an option

  • Save kwmiebach/b0d03afde427a33acf62f994c8f960fa to your computer and use it in GitHub Desktop.

Select an option

Save kwmiebach/b0d03afde427a33acf62f994c8f960fa to your computer and use it in GitHub Desktop.
.tmux.conf
# V15
# This file versioned as gist:https://gist.github.com/kwmiebach/b0d03afde427a33acf62f994c8f960fa
# For the latest version go to above link, then click `raw`, then copy paste from the browser.
# Deep linking it does not work.
# INSTALL FROM GIST as tmux conf file if none exists yet (this could probably fetch an old version):
# curl https://gist.githubusercontent.com/kwmiebach/b0d03afde427a33acf62f994c8f960fa/raw/.tmux.conf > ~/.tmux.conf && cat ~/.tmux.conf | head -n5 | grep V
# RELOAD: tmux source-file ~/.tmux.conf
# TMUX IS SLOW - MAYBE CLEAR ALL SCROLLBACK BUFFERS ESPECIALLY WITH AI:
# tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index}' | xargs -I{} tmux clear-history -t {}
unbind-key C-b
# use ctrl-a as prefix which conflicts with:
# - vim to increase a number in the text
# - fish to go to beginning of line
set-option -g prefix C-a
bind-key C-a send-prefix
# bind-key PageUp copy-mode -u
# Disable plain PageUp entering copy-mode
unbind-key -T root PPage
unbind-key -T root NPage
# Alt+PageUp: enter copy-mode and scroll up one page
bind-key -T root M-PPage copy-mode \; send-keys PPage
# Alt+PageDown: enter copy-mode and scroll down one page
bind-key -T root M-NPage copy-mode \; send-keys NPage
# This is important,
# escape time being too low or zero causes problems with vim and most pgup pgdn and more.
# For old tmux versions
set -sg escape-time 25
# For newer versions. Duplication won't hurt
set -g escape-time 25
bind k kill-window
set -g automatic-rename on
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind-key -n F2 new-window -c "#{pane_current_path}" \; rename-window "-"
bind-key -n F3 previous-window
bind-key -n F4 next-window
# join the right pane into the current with a vertical divider
bind-key -n C-l join-pane -h -s :+1
# and break it again (-a = insert after current window):
bind-key -n M-l break-pane -a \; previous-window
# join the left pane into the current with a vertical divider
# -b = before
bind-key -n C-h join-pane -h -b -s :-1
# and break it again (-b = insert before current window):
bind-key -n M-h break-pane -b \; next-window
# move window left or right with ctrl-shift-F3/4 and select it
# standard implementation
# display-message "including tmux conf alt. 1"
bind-key -n C-S-F3 swap-window -t :-1 \; previous-window
bind-key -n C-S-F4 swap-window -t :+1 \; next-window
# scrollback mode
bind-key -n F7 copy-mode
# rename window F8 or session Ctrl-F8
bind-key -n F8 command-prompt -p "(rename-window) " "rename-window '%%'"
bind-key -n C-F8 command-prompt -p "(rename-session) " "rename-session '%%'"
# color status bar
set -g status-bg black
set -g status-fg '#7FFF00'
# status bar colors and pipe, does not work on some machines, works on debian 11?
setw -g window-status-current-format '#[bg=green,fg=black]#W'
setw -g window-status-format '#W'
setw -g window-status-separator '|'
# Invert colors for the current window:
set-window-option -g window-status-current-style fg=black,bg='#7FFF00'
# remove the asterisk indicating current window:
set-window-option -g window-status-current-format ' #W '
# remove numbering and the colon:
set-window-option -g window-status-format ' #W '
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Disable fancy Unicode characters
# Use if-shell to avoid errors on older versions
# ----------------------------------------------
# pane-border-format: tmux 2.3+ q=suppress error message
set -gq pane-border-format ' '
# pane-border-indicators: tmux 3.2+ q=suppress error message
set -gq pane-border-indicators off
set -g pane-border-format ' '
set -g pane-border-indicators off
# Remove byobu icons and logo
set -g status-left-length 100
set -g status-left '#(echo "#S" | tr a-z A-Z) '
set -g status-right ''
# Proof it loaded fully
display "tmux.conf loaded OK - Some error messages above are normal depending on the tmux version"
run-shell 'echo "tmux.conf loaded OK - Some error messages above are normal depending on the tmux version"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment