Skip to content

Instantly share code, notes, and snippets.

@pablox-cl
Created September 7, 2012 20:55
Show Gist options
  • Save pablox-cl/3669541 to your computer and use it in GitHub Desktop.
Save pablox-cl/3669541 to your computer and use it in GitHub Desktop.
Tmux configuration
# Use C-a instead of C-b as the prefix
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
#set 256 colors
set -g default-terminal "screen-256color"
# set default shell
#set -g default-command "exec /bin/bash"
set -g display-time 2000
#setw -g xterm-keys on
# set vi style key binding
set -g status-keys vi
setw -g mode-keys vi
# be more responsive, changing the default delay
set -sg escape-time 1
# set scrollback
set -g history-limit 10000
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set-window-option -g automatic-rename on
# send prefix to other applications
bind C-a send-prefix
# splitting panes
bind | split-window -h
bind - split-window -v
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Quick pane selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Pane resizing
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
# {{{ Buffer configuration
# remap copy and paste keys to a more vimly style
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# copy text to 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"
# }}}
# {{{ Colours
# set -g status-bg colour234
# set -g window-status-activity-attr bold
# set -g pane-border-fg colour245
# set -g pane-active-border-fg colour39
# set -g message-fg colour16
# set -g message-bg colour221
# set -g message-attr bold
# Status bar
set -g status-bg colour235 # base02
set -g status-fg colour136 # yellow
set -g status-attr none
# default window title colors
setw -g window-status-fg colour244 # base0
setw -g window-status-bg default
# setw -g window-status-attr dim
# # active window title colors
setw -g window-status-current-fg colour61 # violet
setw -g window-status-current-bg colour61 # violet
set-window-option -g window-status-current-attr bright
# Pane
set -g pane-border-fg colour235 # base02
set -g pane-active-border-fg colour240 # base01
set -g pane-active-border-fg colour33
# Pane numbler display
set -g display-panes-active-colour colour33 # blue
set -g display-panes-colour colour166 # orange
# Message
set -g message-bg colour235 # base02
set -g message-fg colour166 # orange
# Clock
set -g clock-mode-colour colour64 # green
# }}}
# Custom status bar
# Powerline symbols: ⮂ ⮃ ⮀ ⮁ ⭤
set -g status-utf8 on
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 2
# set -g status-left '#[fg=colour15,bg=colour238,bold] #S #[fg=colour238,bg=colour234,nobold]⮀'
set -g status-left '#[fg=colour254,bg=colour241] #S #[fg=colour241,bg=colour235]⮀'
set -g status-right '#(pwd) #[fg=colour245]⮃ %R #[fg=colour254]⮂#[bg=colour254,fg=colour235] %d %b' #[fg=colour16,bg=colour254,nobold]' #⮂#[fg=colour16,bg=colour254,bold]'
# set -g window-status-format "#[fg=colour244] #I:#W "
set -g window-status-format "#I:#W"
# set -g window-status-current-format "#[fg=colour235,bg=colour39]⮀#[fg=colour16,bg=colour39,noreverse,bold] #I ⮁ #W #F #[fg=colour39,bg=colour235,nobold]⮀"
set -g window-status-current-format "#[fg=colour235]⮀#[fg=colour234] #I ⮁ #W #F #[fg=default,bg=colour235,nobold]⮀"
# Activity
setw -g monitor-activity on
set -g visual-activity on
# Mouse stuff
setw -g mode-mouse off
setw -g mouse-select-window off
setw -g mouse-select-pane off
setw -g mouse-resize-pane off
# Log output to a text file on demand
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# Maximize and restore a pane
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
# fix shift-{up/down,pgup/pgdown) keys
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
## vim:foldmethod=marker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment