Skip to content

Instantly share code, notes, and snippets.

@cmg-dev
Created July 2, 2017 15:22
Show Gist options
  • Save cmg-dev/32297c3a7a2c725336a455966cc754a7 to your computer and use it in GitHub Desktop.
Save cmg-dev/32297c3a7a2c725336a455966cc754a7 to your computer and use it in GitHub Desktop.
.tmux.conf
set -g default-command "reattach-to-user-namespace -l zsh"
unbind C-b
set -g prefix C-a
bind C-a send-prefix
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# tmux display things in 256 colors
set -g default-terminal "screen-256color"
set -g history-limit 20000
# tmux < v2.1:
if-shell "[[ `tmux -V | cut -d' ' -f2` -lt 2.1 ]]" "setw -g mode-mouse on"
# tmux >= v2.1:
if-shell "[[ `tmux -V | cut -d' ' -f2` -ge 2.1 ]]" "setw -g mouse on"
setw -g mouse on
setw -g xterm-keys on
setw -g monitor-activity off
set -g visual-activity off
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
set -g status-keys vi
setw -g mode-keys v
set -sg escape-time 0
# tmux display things in 256 colors
set -g default-terminal "screen-256color"
# Move pane shortcuts
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# Resize pane shortcuts
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# quickly open a new window
bind N new-window
# synchronize all panes in a window
bind y setw synchronize-panes
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
##############################
### Color & Style Settings ###
##############################
source ~/.dotfiles/tmux/theme.sh
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-open'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment