Skip to content

Instantly share code, notes, and snippets.

@komasaru
Last active March 13, 2022 17:29
Show Gist options
  • Save komasaru/5574812 to your computer and use it in GitHub Desktop.
Save komasaru/5574812 to your computer and use it in GitHub Desktop.
tmux config(setting) file.
# ==== Basic
# Default shell
set-option -g default-shell /bin/bash
set-option -g default-command /bin/bash
# Allow UTF-8
set-window-option -g utf8 on
# Disable ESC delay
set-option -s escape-time 0
# ==== Reload config (r)
bind r source-file ~/.tmux.conf; display-message "Reload Config!!"
# ==== Ke mappings
# Vi binding
set-window-option -g mode-keys vi
# Prefix (^T)
unbind C-b
set-option -g prefix ^T
# ==== Color setting
# Enable 256 color
set-option -g default-terminal "screen-256color"
# Status line
set-option -g status-fg white
set-option -g status-bg black
# Pane border
set-option -g pane-border-fg colour245
set-option -g pane-active-border-fg colour39
# ==== Title of terminal
set-option -g set-titles on
set-option -g set-titles-string "tmux.#I.#W"
# ==== Status line
# Update interval
set-option -g status-interval 5
# Left
set-option -g status-left-length 30
set-option -g status-left '#[fg=yellow]#h[#S:#I.#P] #[default]'
# main
set-option -g window-status-format "[#I #W #F]"
set-option -g window-status-current-format "#[fg=white,bg=green][#I #W #F]#[default]"
# Right
set-option -g status-right-length 150
set-option -g status-right '#[fg=white,bg=blue,bold]%Y/%m/%d(%a) %H:%M#[default]'
# ==== Pane active border
set-option -g pane-active-border-fg black
set-option -g pane-active-border-bg blue
# ==== Log output
bind-key H pipe-pane -o 'cat >> $HOME/.tmux/tmux-#S-#I-#P_`date +%Y%m%d_%H%M%S`_#W.log' \; display-message 'Started logging to $HOME/.tmux/tmux-#S-#I-#P_`date +%Y%m%d_%H%M%S`_#W.log'
bind-key h pipe-pane \; display-message 'Ended logging to $HOME/.tmux/tmux-#S-#I-#P_`date +%Y%m%d_%H%M%S`_#W.log'
# ==== Mouse
set-option -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-option -g mouse-resize-pane on
# ==== Scroll back
#set-option -g history-limit 10000 # default:2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment