Skip to content

Instantly share code, notes, and snippets.

@maciakl
Created August 22, 2023 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maciakl/a7cd200abedfb170d177364ecd83fd92 to your computer and use it in GitHub Desktop.
Save maciakl/a7cd200abedfb170d177364ecd83fd92 to your computer and use it in GitHub Desktop.
Minmal tmux config file for servers
# remap prefix to C-a
set -g prefix C-a
unbind-key C-b
bind-key C-a send prefix
# set 256 bit color mode
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
# resizing
setw -g aggressive-resize on
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# put useful info in the status bar
set-option -g status-interval 1
# automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# highlight the current window in the status bar (blue background)
# #I - window index
# #W - window title
# #F - window flag
set-window-option -g window-status-current-format '#[bg=magenta,fg=white,bold] #I#[fg=white]:#[fg=white,bold]#W#[fg=dim]#F '
# Left side of the status bar
set-option -g status-left '#[bg=blue, fg=white] S[#S] '
# Right side of status bar
# $(echo $USER) - shows the current username
# #H - shows the hostname of your computer
# %h %d %Y - date in the [Mon DD YYYY] format
# %l:%M %p - time in the [HH:MM AM/PM] format
set-option -g status-right-length 60
set -g status-right '#[bg=brightred,fg=yellow] P[#P] #[bg=yellow, fg=black] #{=21:pane_title} #[bg=green, fg=black] %h %d %Y %l:%M %p '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment