Skip to content

Instantly share code, notes, and snippets.

@Kehet
Created May 14, 2017 16:01
Show Gist options
  • Select an option

  • Save Kehet/7f4d8767fdecd1b1fa2f85c3e3acfeb7 to your computer and use it in GitHub Desktop.

Select an option

Save Kehet/7f4d8767fdecd1b1fa2f85c3e3acfeb7 to your computer and use it in GitHub Desktop.
# if run as "tmux attach", create a session if one does not already exist
new-session -n $HOST
# shift arrows for panels
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
# alt arrows for windows
bind -n M-Left previous-window
bind -n M-Right next-window
set -g default-terminal "screen-256color" # colors!
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
set -g prefix2 C-a # GNU-Screen compatible prefix
bind C-a send-prefix -2
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
set -g history-limit 5000 # boost history
# edit configuration
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-nano} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
#set -g set-titles on # set terminal title
#set -g set-titles-string '#h ❐ #S ● #I #W'
set -g display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.05 && tmux clear-history'
# activity
set -g monitor-activity on
set -g visual-activity off
# Status update interval
set -g status-interval 1
# Basic status bar colors
set -g status-bg black
set -g status-fg cyan
# Left side of status bar
set -g status-left-bg black
set -g status-left-fg green
set -g status-left-length 40
set -g status-left "#S #[fg=white]» #[fg=yellow]#I #[fg=cyan]#P"
# Right side of status bar
set -g status-right-bg black
set -g status-right-fg cyan
set -g status-right-length 40
set -g status-right "#H #[fg=white]« #[fg=yellow]%H:%M:%S #[fg=green]%d-%b-%y"
# Window status
set -g window-status-format " #I:#W#F "
set -g window-status-current-format " #I:#W#F "
# Current window status
set -g window-status-current-bg red
set -g window-status-current-fg black
# Window with activity status
set -g window-status-activity-bg yellow # fg and bg are flipped here due to a
set -g window-status-activity-fg black # bug in tmux
# Window separator
set -g window-status-separator ""
# Window status alignment
set -g status-justify centre
# Pane border
set -g pane-border-bg default
set -g pane-border-fg default
# Active pane border
set -g pane-active-border-bg default
set -g pane-active-border-fg green
# Pane number indicator
set -g display-panes-colour default
set -g display-panes-active-colour default
# Clock mode
set -g clock-mode-colour red
set -g clock-mode-style 24
# Message
set -g message-bg default
set -g message-fg default
# Command message
set -g message-command-bg default
set -g message-command-fg default
# Mode
set -g mode-bg red
set -g mode-fg default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment