Skip to content

Instantly share code, notes, and snippets.

@cloud8421
Created April 11, 2012 14:20
Show Gist options
  • Save cloud8421/2359595 to your computer and use it in GitHub Desktop.
Save cloud8421/2359595 to your computer and use it in GitHub Desktop.
Tmux configuration
# most credit goes to https://github.com/joshuaclayton/dotfiles/
set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g default-terminal "xterm-256color"
set -g history-limit 20000
# use VI
set-window-option -g mode-keys vi
# Use ctrl-a instead of ctrl-b
set -g prefix C-a
unbind C-b
bind C-a send-prefix
unbind C-f
bind C-f command-prompt "switch-client -t %%"
# kill
unbind k
bind k confirm-before "kill-window"
unbind ^x
bind ^x kill-pane
# reload config
unbind r
bind r source-file ~/.tmux.conf
unbind ^W
bind ^W split-window -p 25 '$EDITOR $(cat ~/.current-project)' \; swap-pane -D
unbind ^T
bind ^T split-window -p 25
# horizontal and vertical splits
unbind |
bind | split-window -h
unbind _
bind _ split-window
# tile all windows
unbind =
bind = select-layout tiled
# cycle through panes
unbind ^A
bind ^A select-pane -t :.+
unbind Right
bind Right resize-pane -R 8
unbind Left
bind Left resize-pane -L 8
unbind Up
bind Up resize-pane -U 4
unbind Down
bind Down resize-pane -D 4
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l
bind l select-pane -R
# Copy mode works as Vim
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
# Pane colors
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg blue
# status bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-right-length 60
set -g status-left ' '
# set -g status-right '#[fg=blue]#(battery-life) #[fg=green](#(battery-time)) #[fg=blue]%Y-%m-%d %H:%M#[default] '
set-window-option -g window-status-current-bg blue
set-window-option -g window-status-current-fg black
set -g mouse-resize-pane on
set -g mouse-select-pane on
set-window-option -g mode-mouse on
set -g base-index 1
set -s escape-time 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment