Skip to content

Instantly share code, notes, and snippets.

@hayduke19us
Created June 8, 2015 22:38
Show Gist options
  • Save hayduke19us/0b8a4b29d86fe8b73c0a to your computer and use it in GitHub Desktop.
Save hayduke19us/0b8a4b29d86fe8b73c0a to your computer and use it in GitHub Desktop.
# Unbind default prefix of Ctrl-b
unbind C-b
# Bind prefix to Ctrl-a instead of Ctrl-b
set -g prefix C-a
# Binding the prefix to Ctrl-a requires and additional configuration
# to allow us to send that prefix to other commands through tmux
# when we need it, like with Vim and Bash. Now we can send the
# Ctrl-a command through to other programs by pressing Ctrl-a twice.
bind C-a send-prefix
# Reduce delay when sending commands via tmux
set -s escape-time 1
# Make window indexing start at 1 instead of 0
set -g base-index 1
# Make pane indexing start at 1 instead of 0
setw -g pane-base-index 1
# Command to reload .tmux.conf file in the current session and display
# a message in the status line when it is reloaded
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Set horizontal split for new panes to Prefix |
bind | split-window -h
# Set vertical split for new panes to Prefix -
bind - split-window -v
# Remap pane movement keys to Vim style h, j, k, and l.
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# configure buffer movement like vi
set -g mode-keys vi
# copy-mode to be more like vim
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# using usr/local/bin reattach-to-user-namespace with tmux-MacOSX
set -g default-command "reattach-to-user-namespace -l /bin/bash"
# support for copying to system clipboard
bind C-c run "tmux save-buffer | reattach-to-user-namespace pbcopy"
#support for pasting from system clipboard
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
# Make pane resizing easier. Resize panes with a variation of Vim style bindings,
# only uppercase. Thus, Prefix + H, J, K, and L will resize panes at an increment
# of 5 instead of 1.
# Additionally, the command is repeatable after the first Prefix press.
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Enable/Disable mouse mode
setw -g mode-mouse off
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# COLORS
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=
# Make tmux display 256 colors
set -g default-terminal "screen-256color"
# STATUS BAR
# Set status background color
set -g status-bg black
# Set status foreground color
set -g status-fg white
# COMMAND LINE
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# WINDOWS
# Style window status list
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# Style active window
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
# PANES
# Set pane border
set -g pane-border-fg cyan
set -g pane-border-bg black
# Set active pane border
set -g pane-active-border-fg cyan
set -g pane-active-border-bg blue
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# STATUS BAR
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Set width of left side status bar
set -g status-left-length 40
# Make left side of the status bar color the session name, current window,
# and the current pane
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# Make right side of the status bar show current date and time
set -g status-right "#[fg=cyan]%d %b %R"
# Turn on UTF-8 support
set -g status-utf8 on
# Center window list
set -g status-justify centre
# Get notified of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# use my default shell in tmux(or whatever the $SHELL variable is set to)
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment