Skip to content

Instantly share code, notes, and snippets.

@subfuzion
Last active March 25, 2016 05:46
Show Gist options
  • Save subfuzion/b23a0554916be50e449e to your computer and use it in GitHub Desktop.
Save subfuzion/b23a0554916be50e449e to your computer and use it in GitHub Desktop.
My .tmux.conf for tmux < v2.1
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
set -g default-terminal "screen-256color"
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# change default prefix (C-b) to C-space
unbind C-space
set -g prefix C-space
bind C-space send-prefix
# start numbering from 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# bind C-a C-a to last active window
bind-key C-a last-window
# get rid of delay reading command characters while tmux waits for escape sequence
set -s escape-time 1
# reload ~/.tmux.conf using prefix r
bind r source-file ~/.tmux.conf \; display "tmux reloaded"
# change split prefixes (horizontal: C-space /) (vertical: C-space -)
bind / split-window -h
bind - split-window -v
# make current window the 1st window
bind T swap-window -t 1
# set scrollback history to 10K lines
set -g history-limit 10000
# mouse support
setw -g mode-mouse on
set -g mouse-select-window on
set -g mouse-select-pane on
set -g mouse-resize-pane on
# vi
====
setw -g mode-keys vi
set -g status-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 (os x)
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# map vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# use vi left and right to cycle thru panes
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# resize panes using vi keys
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
# status bar
# ==========
# set status bar
set -g status-justify centre
#set -g status-left ""
#set -g status-right "#[fg=green]#H"
# theme
#set -g status-bg "#222222"
#set -g status-fg "#009000"
setw -g monitor-activity on
set -g visual-activity on
# show host name and IP address on left side of status bar
# set -g status-left-length 70
# informational (but takes room)
# set -g status-left "#h #(curl -4 https://icanhazip.com) #(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') "
# show session name, window & pane number, date and time on right
# of status bar
# set -g status-right-length 60
# set -g status-right "#S #I:#P %d %b %Y %l:%M %p (#(date -u | awk '{print $4}' | cut -c1-5))"
set-option -g set-titles on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment