Skip to content

Instantly share code, notes, and snippets.

@ryane
Created April 5, 2013 19:50
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 ryane/5322099 to your computer and use it in GitHub Desktop.
Save ryane/5322099 to your computer and use it in GitHub Desktop.
tmux.conf
# fix copy/paste
set-option -g default-shell /usr/local/bin/zsh
set-option -g default-command "reattach-to-user-namespace -l \"/usr/local/bin/zsh\""
bind-key 'P' run-shell "tmux set-buffer \"$(/usr/local/bin/pbpaste)\"; tmux paste-buffer"
bind-key 'Y' run-shell "tmux show-buffer | /usr/local/bin/pbcopy"
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
# look good
set -g default-terminal "screen-256color"
# no auto rename
setw -g automatic-rename off
# remap prefix to Control + a
set -g prefix C-a
unbind C-a
bind C-a send-prefix
# be responsive
set -sg escape-time 1
# start with 1
set -g base-index 1
set -g pane-base-index 1
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# resizable
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
# screw the mouse
setw -g mode-mouse off
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# quick pane cycling
unbind ^E
bind ^E select-pane -t :.+
# quick window cycling
bind-key C-w last-window
bind-key C-l last-window
# better pane splitting
unbind %
bind | split-window -h
bind - split-window -v
# style
#set -g status-fg white
#set -g status-bg black
#setw -g window-status-fg cyan
#setw -g window-status-bg default
#setw -g window-status-attr dim
#setw -g window-status-current-fg white
#setw -g window-status-current-bg red
#setw -g window-status-current-attr bright
#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 yellow
#set -g message-fg white
#set -g message-bg black
#set -g message-attr bright
#set -g status-left-length 40
#set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
#set -g status-utf8 on
## Status line right side
## 15% | 28 Nov 18:15
#set -g status-right "#[fg=cyan]%d %b %R"
## Update the status bar every sixty seconds
#set -g status-interval 60
## Center the window list
#set -g status-justify centre
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# from https://github.com/myusuf3/dotfiles/blob/master/tmux
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
# Custom status bar
# Powerline symbols: ⮂ ⮃ ⮀ ⮁ ⭤
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5
# set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour238,nobold]⮀#[fg=colour15,bg=colour238,bold] #(ls ~/.mail/yusuf.mahdi@gmail.com/INBOX/cur ~/.mail/yusuf.mahdi@gmail.com/INBOX/new | wc -l | tr -d " ") #[fg=colour238,bg=colour234,nobold]⮀'
set -g status-right '#[fg=colour245]⮃ %R ⮃ %d %b #[fg=colour254,bg=colour234,nobold]#(rdio-current-track-tmux)⮂#[fg=colour16,bg=colour254,bold] #h '
set -g window-status-format "#[fg=white,bg=colour234] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour16,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀"
set -g default-terminal "screen-256color"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment