Skip to content

Instantly share code, notes, and snippets.

@duggiefresh
Created August 29, 2013 02:58
Show Gist options
  • Save duggiefresh/6373783 to your computer and use it in GitHub Desktop.
Save duggiefresh/6373783 to your computer and use it in GitHub Desktop.
My .tmux.conf
# Remap prefix to C-a
set -g prefix C-a
unbind C-b
#shorten escape time
set -sg escape-time 1
# Use 1-based indexes
set -g base-index 1
setw -g pane-base-index 1
# Prefix r reloads the tmux conf
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Prefix Prefix sends C-a
bind C-a send-prefix
#Remap split commands
bind | split-window -h
bind - split-window -v
# Use vim movements for switching panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use vim navigation for resizing panes
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
# Turn on mouse control
setw -g mode-mouse on
# Enables 256-color support
set -g default-terminal "screen-256color"
# Sets status bar colors
set -g status-fg white
set -g status-bg black
# Sets pane colors
set -g pane-border-fg white
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg white
# Sets status bar
set -g status-interval 60
set -g status-utf8 on
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
set -g status-right "#[fg=cyan]%d %b %R"
set -g status-justify centre
setw -g monitor-activity on
set -g visual-activity on
# Makes tmux buffer selection work like 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
# Allows tmux to interface with the Mac clipboard
set -g default-command "/bin/zsh"
#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"
# Pane/Window manipulation
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
# Log pane to file
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment