Skip to content

Instantly share code, notes, and snippets.

@bobmaerten
Created July 20, 2012 13:49
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 bobmaerten/3150830 to your computer and use it in GitHub Desktop.
Save bobmaerten/3150830 to your computer and use it in GitHub Desktop.
Mon .tmux.conf actuel
# status bar
set-option -g status-utf8 on
# left side of status bar
set -g status-left-length 30
set -g status-left '#S #h'
# right side of status bar
set -g status-right-length 30
set -g status-right '%Y-%m-%d | %H:%M #[default]'
# status bar options
set -g status-interval 1
set-option -g status-justify centre # alignment of windows
set-window-option -g window-status-format ' #W ' # Inactive windows in status bar
# default statusbar colors
set -g status-fg white
set -g status-bg default
set -g status-attr bright
# default window title colors
set-window-option -g window-status-fg white
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg red
set-window-option -g window-status-current-attr bright
set-window-option -g window-status-format ' #I:#W '
set-window-option -g window-status-current-format ' #I:#W '
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# copy a handful of useful environment variables into new shells from the parent environment
set -g update-environment -r
set-window-option -g xterm-keys on
# alt+left/right cycles thru windows
bind-key -n C-right next
bind-key -n C-left prev
# helpers to resize panes
bind-key -n C-h resize-pane -L 5
bind-key -n C-l resize-pane -R 5
bind-key -n C-k resize-pane -U 5
bind-key -n C-j resize-pane -D 5
bind-key -n C-Npage select-pane -t :.+
bind-key -n C-Ppage select-pane -t :.-
# split windows helpers
unbind %
bind-key | split-window -h
unbind '"'
bind-key _ split-window -v
# Ctrl-B C to open a new window to an ssh host
bind-key C command-prompt -p ssh: "new-window -n %1 'ssh %1'"
# Allows for faster key repetition
set -s escape-time 0
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes 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
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Toggle mouse on with ^B m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# + and - "zoom" and "unzoom" a pane.
# + breaks a pane out to its own window
# - restores a broken-out pane to being a pane
unbind +
bind + \
new-window -d -n tmux-zoom \;\
swap-pane -s tmux-zoom \;\
select-window -t tmux-zoom
unbind -
bind - \
last-window \;\
swap-pane -s tmux-zoom \;\
kill-window -t tmux-zoom
# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-y run "tmux show-buffer | xclip -i"
# Vi copypaste mode
set-window-option -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment