Skip to content

Instantly share code, notes, and snippets.

@KalenAnson
Last active August 31, 2017 18:25
Show Gist options
  • Save KalenAnson/7ae6f3cbc685b3debdd6ba30f3f10e01 to your computer and use it in GitHub Desktop.
Save KalenAnson/7ae6f3cbc685b3debdd6ba30f3f10e01 to your computer and use it in GitHub Desktop.
################################################################################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
################################################################################
# ø
################################################################################
################################################################################
# Unbind Keys
################################################################################
unbind [ # copy mode bound to escape key
unbind '"' # unbind horizontal split
unbind % # unbind vertical split
################################################################################
# CTRL-A instead of CTRL-B
################################################################################
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
################################################################################
# Other Bindings
################################################################################
# Make escape the key to start copy mode (also CTRL-[)
bind Escape copy-mode
# New split in current pane (horizontal / vertical)
bind-key - split-window -v # split pane horizontally
bind-key \ split-window -h # split pane vertically
# Bind vim moment keys for switching between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
################################################################################
# Global options
################################################################################
set -g default-shell $SHELL # Set Shell
set -g history-limit 10000 # History
set -g bell-action any # Listen for activity on all windows
set -g display-panes-time 2000
set -g visual-activity on
set -g visual-bell on
set -g default-terminal "screen-256color" # "xterm-256color"
set -g set-titles-string "tmux:#I #W" # wm window title string
set -g set-titles on # enable wm window titles
setw -g xterm-keys on # Vim
setw -g mode-keys vi # Vi
# Reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
################################################################################
# Status Bar
################################################################################
set -g status on
set -g status-justify centre
set -g status-interval 5
set -g status-bg colour045
set -g status-fg colour016
set -g status-attr bright
set -g status-interval 5
set -g status-justify centre
set -g status-left-length 90
set -g status-right-length 100
set -g status-right ""
set -g status-left ""
################################################################################
# Theme
################################################################################
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-current-bg colour027
setw -g window-status-current-fg colour015
setw -g window-status-current-attr bright
setw -g window-status-bg colour039
setw -g window-status-fg colour240
setw -g window-status-attr bright
set-window-option -g window-status-bell-attr none
set-window-option -g window-status-bell-bg colour9
# Messages
set -g message-fg colour016
set -g message-bg colour046
set -g message-attr bright
# Panes
set -g pane-active-border-bg default
set -g pane-active-border-fg red
set -g pane-border-bg default
set -g pane-border-fg default
# Left side status bar
set -g status-left-length 90
# Hostname
set -g status-left "#{?client_prefix,#[reverse],}#[bg=colour027,fg=colour015] #h "
# Interface addresses
set -ga status-left "#[bg=colour033,fg=colour016]#(ip addr show en0 | grep 'inet ' | awk '{print \" #[fg=colour017]en0:#[fg=colour015]\" $2 }') "
set -ga status-left "#[bg=colour039,fg=colour016]#(ip addr show en3 | grep 'inet ' | awk '{print \" #[fg=colour017]en3:#[fg=colour015]\" $2 }') "
# System Load (Optional)
# Requires https://github.com/thewtex/tmux-mem-cpu-load
#set -ga status-left " #[bg=colour039,fg=colour016] #(tmux-mem-cpu-load --interval 2) "
# Right side status bar
set -g status-right-length 90
# Tmux session
set -ga status-right "#[bg=colour039,fg=colour015] #S #I:#P "
# Date
set -ga status-right "#[bg=colour033,fg=colour015] %d %b %Y "
# Time
set -ga status-right "#[bg=colour027,fg=colour015] %H:%M "
################################################################################
# Sessions
################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment