Skip to content

Instantly share code, notes, and snippets.

@megawubs
Last active February 18, 2016 06:44
Show Gist options
  • Save megawubs/bca69c643a1c650cadde to your computer and use it in GitHub Desktop.
Save megawubs/bca69c643a1c650cadde to your computer and use it in GitHub Desktop.
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
# END:unbind
#setting the delay between prefix and command
# START:delay
#set -sg escape-time 1
# END:delay
# Ensure that we can send Ctrl-A to other apps
# START:bind_prefix
bind C-a send-prefix
# END:bind_prefix
# Set the base index for windows to 1 instead of 0
# START:index
set -g base-index 1
# END:index
# Set the base index for panes to 1 instead of 0
# START:panes_index
setw -g pane-base-index 1
# END:panes_index
# Reload the file with Prefix r
# START:reload
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# END:reload
# splitting panes
# START:panesplit
bind | split-window -h
bind - split-window -v
# END:panesplit
# moving between panes
# START:paneselect
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
# END:paneselect
# Quick pane selection
# START:panetoggle
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# END:panetoggle
# Pane resizing
# START:paneresize
bind -r A resize-pane -L 5
bind -r S resize-pane -D 5
bind -r W resize-pane -U 5
bind -r D resize-pane -R 5
# END:paneresize
# mouse support - set to on if you want to use the mouse
# START:mouse
set -g mouse-utf8 on
setw -g mouse on
# END:mouse
# Set the default terminal mode to 256color mode
# START:termcolor
set -g default-terminal "screen-256color"
# END:termcolor
# enable activity alerts
#START:activity
setw -g monitor-activity on
set -g visual-activity on
#END:activity
# set the status line's colors
# START:statuscolor
set -g status-fg white
set -g status-bg black
# END:statuscolor
# set the color of the window list
# START:windowstatuscolor
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# END:windowstatuscolor
# set colors for the active window
# START:activewindowstatuscolor
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
# END:activewindowstatuscolor
# pane colors
# START:panecolors
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg yellow
# END:panecolors
# Command / message line
# START:cmdlinecolors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# END:cmdlinecolors
# Status line left side
# START:statusleft
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# END:statusleft
#START:utf8
set -g status-utf8 on
#END:utf8
# Status line right side
# 15% | 28 Nov 18:15
# START: statusright
#set -g status-right "#(pmset -g batt | egrep \"([0-9]+\%).*;*g\" -o --colour=auto | cut -f1 -d';')" | #[fg=cyan]%d %b %R"
set -g status-interval 2
set -g status-right "#(tmux-mem-cpu-load --interval 2)#"
set -g status-left-length 60
# END:statusright
# Update the status bar every sixty seconds
# START:updateinterval
set -g status-interval 10
# END:updateinterval
# Center the window list
# START:centerwindowlist
set -g status-justify centre
# END:centerwindowlist
# enable vi keys.
# START:vikeys
setw -g mode-keys vi
# END:vikeys
# Open panes in the same directory using the tmux-panes script
# START:tmuxpanes
#unbind v
unbind n
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
#bind v send-keys " ~/tmux-panes -h" C-m
#bind n send-keys " ~/tmux-panes -v" C-m
# END:tmuxpanes
# Log output to a text file on demand
# START:pipe-pane
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# END:pipe-pane
unbind x
bind x kill-pane
bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \; send-keys -M
unbind s
bind s split-window -h
bind e choose-tree
bind ` split-window -v
unbind x
bind x display-panes
unbind q
bind q kill-pane
@megawubs
Copy link
Author

Be sure to install tmux-mem-cpu-load by adding antigen bundle thewtex/tmux-mem-cpu-load to your ~/.zshrc file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment