Skip to content

Instantly share code, notes, and snippets.

@alok87
Created May 23, 2016 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alok87/635b12a107b669b416020a935c1fa16d to your computer and use it in GitHub Desktop.
Save alok87/635b12a107b669b416020a935c1fa16d to your computer and use it in GitHub Desktop.
tmux basic conf
unbind C-b
# set -g prefix `
# bind-key ` send-prefix
# Example tmux.conf
# 2014.10
### General
###########################################################################
set -g mouse on
# Use vim keybindings in copy mode
setw -g mode-keys vi
# 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"
# Enable UTF-8
setw -g utf8 on
set-option -g status-utf8 on
# Scrollback/History limit
set -g history-limit 2048
# Index Start
set -g base-index 1
# Mouse
# set-option -g mouse-select-pane on
# Force reload of config file
unbind r
bind r source-file ~/.tmux.conf
### Keybinds
###########################################################################
# Unbind C-b as the default prefix
unbind C-b
# Set new default prefix
set-option -g prefix `
# Return to previous window when prefix is pressed twice
bind C-a last-window
bind ` last-window
# Allow swapping C-a and ` using F11/F12
bind F11 set-option -g prefix C-a
bind F12 set-option -g prefix `
# Keybind preference
setw -g mode-keys vi
set-option -g status-keys vi
# Moving between panes with vim movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Window Cycle/Swap
bind e previous-window
bind f next-window
bind E swap-window -t -1
bind F swap-window -t +1
# Activate inner-most session (when nesting tmux) to send commands
bind a send-prefix
### Theme
###########################################################################
# Statusbar Color Palatte
set-option -g status-justify left
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left-length 40
set-option -g status-right-length 80
# Pane Border Color Palette
set-option -g pane-active-border-fg green
set-option -g pane-active-border-bg black
set-option -g pane-border-fg white
set-option -g pane-border-bg black
# Message Color Palette
set-option -g message-fg black
set-option -g message-bg green
### UI
###########################################################################
# Notification
setw -g monitor-activity on
set -g visual-activity on
set-option -g bell-action any
set-option -g visual-bell off
# Automatically set window titles
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not)
# Statusbar Adjustments
set -g status-left "#[fg=red] #H#[fg=green]:#[fg=white]#S#[fg=green] |#[default]"
# Show performance counters in statusbar
# Requires https://github.com/thewtex/tmux-mem-cpu-load/
set -g status-interval 4
set -g status-right "#[fg=green] | #[fg=white]#(tmux-mem-cpu-load)#[fg=green] | #[fg=cyan]%H:%M #[default]"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Tmux-resurrect programs to restore list
set -g @resurrect-processes ':all:'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment