Skip to content

Instantly share code, notes, and snippets.

@imiric
Created April 13, 2026 16:03
Show Gist options
  • Select an option

  • Save imiric/9bd3e5b7fc5e1468d05abc674f42ed6e to your computer and use it in GitHub Desktop.

Select an option

Save imiric/9bd3e5b7fc5e1468d05abc674f42ed6e to your computer and use it in GitHub Desktop.
.tmux.conf
# Use something easier to type as the prefix.
set-option -g prefix `
# set-option -g prefix C-a
unbind-key C-b
bind-key C-a last-window
bind-key ` last-window
bind-key a send-prefix
# we might need ` at some point, allow switching
# we can also send the prefix char with `-a
bind-key F11 set-option -g prefix C-a
bind-key F12 set-option -g prefix `
set-option -g status-justify centre
# Relax!
set -sg escape-time 0
set -sg repeat-time 600
# Mouse
set-option -g mouse on
# This is hilariously absurd. How many nerds use tmux on OS X every day and
# it's still fundamentally broken?
#set -g default-command "reattach-to-user-namespace -l zsh"
#set -g default-command "reattach-to-user-namespace -l fish"
# Less stretching to get to the first item.
set -g base-index 1
setw -g pane-base-index 1
# making panes with | and -
unbind %
bind | split-window -h
bind - split-window -v
# making copying easier by using vim shortcuts
set-window-option -g mode-keys vi
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind-key -T copy-mode-vi 'H' send -X start-of-line
bind-key -T copy-mode-vi 'L' send -X end-of-line
bind-key -T copy-mode-vi 'Escape' send -X cancel
#bind-key -t vi-copy v begin-selection
#bind-key -t vi-copy y copy-selection
#bind-key -t vi-copy C-v rectangle-toggle
# other ^A
#unbind ^A
bind ` last-window
bind S choose-session
# " windowlist -b
unbind '"'
bind '"' choose-window
# detach ^D d
unbind ^D
bind ^D detach
# quit \
unbind \
bind \ confirm-before "kill-server"
# kill K k
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"
# History
set -g history-limit 1000000
# Clipboard
set -g set-clipboard on
set -g allow-passthrough on
# Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24
bind -n F9 new-window
bind -n F10 command-prompt "rename-window %%"
bind -n F11 previous-window
bind -n F12 next-window
# Reload the config.
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Pane resizing
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#{?#{||:#{==:#{pane_current_command},zsh},#{==:#{pane_current_command},bash}},#{b:pane_current_path},#{pane_current_command}}'
# 256 colors please
set -g default-terminal "xterm-256color"
# fix buffer clobber and clear not working in some terminals
# see https://github.com/tmux/tmux/issues/1584#issuecomment-455877974
#set -gas terminal-overrides ',*:indn@'
# Automatically set window title
setw -g automatic-rename on
# Activity
setw -g monitor-activity on
set -g visual-activity off
# Autorename sanely.
setw -g automatic-rename on
# Better name management
bind c new-window
bind , command-prompt "rename-window '%%'"
# Load powerline theme
source-file "${HOME}/.tmux-themepack/powerline/default/blue.tmuxtheme"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment