Skip to content

Instantly share code, notes, and snippets.

@zenshell
Last active October 7, 2015 10:57
Show Gist options
  • Save zenshell/3154279 to your computer and use it in GitHub Desktop.
Save zenshell/3154279 to your computer and use it in GitHub Desktop.
tmux configuration file
################################
# change prefix to C-o #
################################
set -g prefix C-o
unbind-key C-b
bind-key o send-prefix
################################
# options #
################################
set -g default-terminal "screen-256color"
set -g repeat-time 1000
################################
# window options #
################################
setw -g mode-keys vi
################################
# mouse #
################################
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
################################
# vim #
################################
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind v split-window -h
################################
# buffer edit #
################################
bind y copy-mode
bind Space paste-buffer
bind a choose-buffer
bind b show-buffer
################################
# system clipboard #
################################
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
################################
# pane resize #
################################
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
################################
# pane scale #
################################
bind m new-window -d -n max\; swap-pane -s :max.0\; select-window -t max
bind e last-window\; swap-pane -s :max.0\; kill-window -t max
################################
# pane join #
################################
bind C-f command-prompt -p "join pane from:,horizontal/vertical [h/v]:" "join-pane -s '%%' -'%%'"
bind C-t command-prompt -p "join pane to:,horizontal/vertical [h/v]:" "join-pane -t '%%' -'%%'"
################################
# statusbar #
################################
set -g status-interval 1
set -g status-keys vi
set -g status-justify centre
set -g status-bg colour235
set -g status-fg colour186
set -g status-attr dim
#left
set -g status-left "#[fg=colour208]» #[fg=colour148]s#[fg=colour81]#S #[fg=colour197]• #[fg=colour148]w#[fg=colour81]#I #[fg=colour197]• #[fg=colour148]p#[fg=colour81]#P#[default]"
set -g status-left-attr dim
set -g status-left-length 20
#right
set -g status-right "#[fg=colour141]#(cut -d ' ' -f 1-3 /proc/loadavg)"
set -g status-right-attr dim
set -g status-right-length 20
setw -g window-status-current-fg colour197
setw -g window-status-current-bg colour237
setw -g window-status-current-attr dim
################################
# command / message line #
################################
set -g message-fg green
set -g message-bg black
################################
# source configuration #
################################
bind r source-file ~/.tmux.conf\; display "Reloaded!"
@zenshell
Copy link
Author

Use tmux -2 to enable 256 colors

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