Skip to content

Instantly share code, notes, and snippets.

@adojos
Last active March 9, 2023 11:00
Show Gist options
  • Save adojos/c5e718e4a0d2bea33043c3400919d11a to your computer and use it in GitHub Desktop.
Save adojos/c5e718e4a0d2bea33043c3400919d11a to your computer and use it in GitHub Desktop.
Linux: TMUX Basic Configuration File #linux
## ------------------
## General Settings
## ------------------
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# set scrollback history to 2000 (10k)
set -g history-limit 2000
# Reload tmux config
bind r source-file ~/.tmux.conf
# Enable mouse control (scrolling, clicking, resizing)
set -g mouse on
# shorten command delay
set -sg escape-time 50
# default login shell for new windows/pane
#set-option -g default-shell /usr/bin/zsh
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
set-option -g renumber-windows on
## ----------------------
## Pane Settings & Style
## ----------------------
# set pane colors - highlight active pane
setw -g pane-border-style fg=colour235
setw -g pane-active-border-style bg=default,fg=colour245
# Dim-out any pane that's not active.
setw -g window-style fg=white,bg=colour236
setw -g window-active-style fg=white,bg=colour235
# Command / Message line
# set-window-option -g message-style fg=black,bold,bg=colour11
# split panes using | (horizontally) and - (vertically)
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
## ----------------------
## Status Bar
## ----------------------
# turn the status bar on
set-option -g status on
# set update frequencey (default 15 seconds)
set -g status-interval 10
# center window list for clarity
set -g status-justify centre # [left | centre | right]
#set-option -g status-position top # position the status bar [top, bottom]
## set color for whole status bar
set -g status-style bg=colour240,fg=default
#Centre Bar
set-window-option -g window-status-style fg=colour118,bg=colour04
set-window-option -g window-status-current-style fg=black,bold,bg=green,bright
set-window-option -g window-status-last-style fg=black,bold,bg=green,bright
set-window-option -g window-status-separator |
# Left Side Bar
set-option -g status-left-length 75 # default 10
set-option -g status-left "[#[fg=green,bright] S: #S, #[fg=colour208]W #I-#W, #[fg=colour178]P: #P #[fg=white]]"
# Right Side Bar
set-option -g status-right-length 120 # default 50
#set-option -g status-right "#[fg=grey,dim,bg=default] uptime: #(uptime | cut -f 4-5 -d\" \" | cut -f 1 -d\",\")"
set -ag status-right "#[fg=cyan,bg=default]  %a %d #[default]"
#set -g status-right "#[fg=colour245]%d %b #[fg=colour256] %R"
# Activity Alerts
set-option -g status-interval 10 # Update the status line every 60 seconds (15 is default)
set-window-option -g monitor-activity on # highlights the window name in the status line
set -g visual-activity on
## ------------------------
## Plugin Manager & Plugins
## ------------------------
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
# Last saved environment is automatically restored when tmux is started.
set -g @continuum-boot 'on'
# terminal window will go fullscreen
set -g @continuum-boot-options 'fullscreen'
# Hit prefix + I to install plugins for the first time.
# It takes few seconds. So, wait before panic.
#
# resurrect key bindings:
# prefix + Ctrl-s - save
# prefix + Ctrl-r - restore
# Initialize TMUX Plugin Manager (keep this at very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment