Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
Last active November 29, 2017 16:14
Show Gist options
  • Save tskrynnyk/ec19c15df0f9955c3955e79a31b33478 to your computer and use it in GitHub Desktop.
Save tskrynnyk/ec19c15df0f9955c3955e79a31b33478 to your computer and use it in GitHub Desktop.
tmux config
# ~/.tmux.conf
#
TMUX_COLOUR_FG="colour232"
TMUX_COLOUR_BG="colour33"
TMUX_COLOUR_BOLD="colour252"
TMUX_COLOUR_DARK="colour0"
TMUX_COLOUR_NORMAL=$TMUX_COLOUR_BOLD
TMUX_COLOUR_ACTIVE=$TMUX_COLOUR_BG
source-file ~/.tmux/config
# ~/.tmux/config
#
set-option -g default-terminal "screen-256color"
# ------------------------------------------------------------------------------
# screen-like
set-option -g prefix C-a
unbind-key C-b
bind-key a send-prefix
bind-key C-a last-window
bind-key Space next-window
bind-key C-Space previous-window
set-option -g base-index 1
set-option -g pane-base-index 1
# amount of time for which status line messages and other indicators
# are displayed. time is in milliseconds.
set-option -g display-time 2000
# Set the esc/alt disambiguation timeout to 50ms. The default is half a second, which makes vim kind of painful.
set-option -sg escape-time 50
#set-option -g lock-after-time 3600
# ------------------------------------------------------------------------------
# xterm
set-window-option -g xterm-keys on
set-option -g history-limit 5000
set-option -g set-titles on
#set-option -g set-titles-string '#T:#I-#W'
set-option -g set-titles-string '#H #S:#I:#W'
#set-option -g terminal-overrides 'xterm*:XT:smcup@:rmcup@'
# ------------------------------------------------------------------------------
# Status bar
set-window-option -g window-status-format '#{window_index}:#{window_name}#{?window_flags,#{window_flags},}'
set-window-option -g window-status-current-format "#[reverse] #{window_index}:#[bg=$TMUX_COLOUR_BOLD,reverse]#{window_name}#{?window_flags,#{window_flags},} "
set-option -g status-interval 5
set-option -g status-left ' '
set-option -g status-right-length 68
#set-option -g status-right " #H:#S "
#set-option -g status-right " #H:#S | %d/%m %H:%M "
#set-option -g status-right " #H:#S | #(cut -d ' ' -f 1-4 /proc/loadavg) | %d/%m %H:%M "
#set-option -g status-right "[#S] #[fg=default,reverse,bg=white,bold] #H #[default] %H:%M "
#set-option -g status-right "[#S] #[reverse] #(hostname -I)#[fg=$TMUX_COLOUR_BOLD,bg=$TMUX_COLOUR_FG,reverse] #H #[default] %H:%M "
set-option -g status-right \
"[#S:#I:#P] #[bold]#(cut -d ' ' -f 1-4 /proc/loadavg) #[reverse,nobold] #(hostname -I)#[fg=$TMUX_COLOUR_BOLD,bg=$TMUX_COLOUR_FG,reverse] #H #[default] %d/%m %H:%M "
# ------------------------------------------------------------------------------
# Window notifications
set-window-option -g monitor-activity on
set-window-option -g visual-activity off
set-window-option -g allow-rename off
# ------------------------------------------------------------------------------
# Clock
set-window-option -g clock-mode-style 24
# ------------------------------------------------------------------------------
# Commands
bind-key C-r source-file ~/.tmux.conf\; display " Configuration reloaded!"
# New windows should start in the same directory as the current pane
bind-key c neww -c "#{pane_current_path}"
bind-key @ command-prompt -p "(join pane)" "join-pane -s ':%%'"
bind-key C-@ command-prompt -p "(break pane)" "break-pane -t ':%%'"
bind-key > command-prompt -p "(swap window)" "swap-window -t '%%'"
# ------------------------------------------------------------------------------
# Colors
# for i in {0..255}; do printf "\x1b[38;5;${i}mcolor%-5i\x1b[0m" $i ; if ! (( ($i + 1 ) % 8 )); then echo ; fi ; done
set-option -g status-style fg=$TMUX_COLOUR_FG,bg=$TMUX_COLOUR_BG
set-option -g window-status-style fg=$TMUX_COLOUR_FG,bg=$TMUX_COLOUR_BG,default
set-option -g window-status-current-style fg=default,reverse,bg=default,reverse
set-option -g status-left-style fg=default,bg=default
set-option -g status-right-style fg=default,bg=default
set-window-option -g window-status-bell-style fg=$TMUX_COLOUR_FG,bg=$TMUX_COLOUR_BOLD,none
set-window-option -g window-status-activity-style fg=default,bg=default,bold
set-option -g message-style fg=$TMUX_COLOUR_BG,bg=$TMUX_COLOUR_FG
set-option -g message-command-style fg=$TMUX_COLOUR_BG,bg=$TMUX_COLOUR_FG
set-option -g pane-border-style fg=$TMUX_COLOUR_NORMAL
set-option -g pane-active-border-style fg=$TMUX_COLOUR_ACTIVE
set-option -g display-panes-colour $TMUX_COLOUR_NORMAL
set-option -g display-panes-active-colour $TMUX_COLOUR_ACTIVE
set-window-option -g clock-mode-colour $TMUX_COLOUR_ACTIVE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment