Skip to content

Instantly share code, notes, and snippets.

@xeonchen
Last active June 28, 2016 12:50
Show Gist options
  • Save xeonchen/f879ef997599f478975da3f2efb4b805 to your computer and use it in GitHub Desktop.
Save xeonchen/f879ef997599f478975da3f2efb4b805 to your computer and use it in GitHub Desktop.
# fix terminal-notifier hang issue under tmux (Mac only)
# set -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL -l"
# Set the prefix to ^A.
unbind C-b
set -g prefix C-A
bind a send-prefix
# Set status
set-option -g status-justify centre
set-option -g status-bg '#111111'
set-option -g status-fg brightyellow
set-option -g status-interval 10
set-option -g status-left-length 50
set-option -g status-left '#[fg=white](#S) #[fg=yellow]#(whoami)#[fg=#333333]@#[fg=red]#h #[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default]'
set-option -g status-right '#[fg=magenta]%a %Y/%m/%d %H:%M#[default] '
# Set key mode
set-window-option -g mode-keys vi
# Set TERM
set -g default-terminal "screen-256color"
# Do not wait Esc
set -sg escape-time 0
# Reload key
bind r source-file ~/.tmux.conf
# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client
# last-window
unbind ^A
bind ^A last-window
# kill-server
#unbind '\'
#bind '\' confirm-before "kill-server"
# kill-window
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"
# choose-window
unbind '"'
bind '"' choose-window
# new-window
unbind -n M-t
bind -n M-t new-window -c "#{pane_current_path}"
# split-window
unbind |
bind | split-window -h -c "#{pane_current_path}"
unbind -
bind - split-window -v -c "#{pane_current_path}"
# rename-window
unbind e
bind e command-prompt -p "rename window:" "rename-window %%"
# select-window
unbind -n M-`
bind -n M-` select-window -t :0
unbind -n M-1
bind -n M-1 select-window -t :1
unbind -n M-2
bind -n M-2 select-window -t :2
unbind -n M-3
bind -n M-3 select-window -t :3
unbind -n M-4
bind -n M-4 select-window -t :4
unbind -n M-5
bind -n M-5 select-window -t :5
unbind -n M-6
bind -n M-6 select-window -t :6
unbind -n M-7
bind -n M-7 select-window -t :7
unbind -n M-8
bind -n M-8 select-window -t :8
unbind -n M-9
bind -n M-9 select-window -t :9
unbind -n M-0
bind -n M-0 select-window -t :10
unbind -n M--
bind -n M-- select-window -t :11
unbind -n M-=
bind -n M-= select-window -t :12
# select-pane
unbind -n M-h
bind -n M-h select-pane -L
unbind -n M-j
bind -n M-j select-pane -D
unbind -n M-k
bind -n M-k select-pane -U
unbind -n M-l
bind -n M-l select-pane -R
# resize-pane
unbind -n M-Left
bind -n M-Left resize-pane -L
unbind -n M-Down
bind -n M-Down resize-pane -D
unbind -n M-Up
bind -n M-Up resize-pane -U
unbind -n M-Right
bind -n M-Right resize-pane -R
# pane movement
unbind j
bind j command-prompt -p "join this pane to:" "join-pane -t '%%'"
# kill-pane
unbind -n M-w
bind -n M-w confirm-before "kill-pane"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment