Skip to content

Instantly share code, notes, and snippets.

@6ewis
Created November 17, 2014 17:03
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 6ewis/d6cbe45544b6e9628a66 to your computer and use it in GitHub Desktop.
Save 6ewis/d6cbe45544b6e9628a66 to your computer and use it in GitHub Desktop.
#Use backtick as the prefix
# Do it just like this or you will not
# be able to use type backtick literally
unbind C-b
set -g prefix `
bind ` send-prefix
bind-key l last-window
unbind %
bind '|' split-window -h
unbind '"'
bind '-' split-window -nv
set -g default-terminal "screen-256color"
set -g default-command "reattach-to-user-namespace -l bash"
# Start numbering at 1
set -g base-index 1
# Make mouse useful in copy mode
setw -g mode-mouse on
#
# Allow mouse to select which pane to use
set -g mouse-select-pane on
#
#
# # Scroll History
set -g history-limit 30000
#
# # Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
#
# Basically allows for faster key repetition
set -s escape-time 0
# Set status bar
set -g status-justify left
set -g status-bg black
set -g status-fg white
set-option -g status-interval 5
set -g status-right-length 150
set -g status-left ""
set -g status-right "#[fg=green] %m-%d-%Y %H:%M #(whoami)" # Add space so I can see Growl notifications in full-screen mode
# 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
# Allows us to use '<prefix>-a' <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Highlight active window
set-window-option -g window-status-current-bg red
# Turn on vi bindings in copy mode
set-option -g status-keys vi
set-window-option -g mode-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"
#
# Move around panes vim style
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key M-7 resize-pane -t 1 -x 90
bind-key M-8 resize-pane -t 1 -x 60
bind-key M-9 resize-pane -t 1 -x 30
bind-key M-0 resize-pane -t 0 -x 30
# Copy to OSX clipboard
bind-key y run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy"
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'ssh psql mysql sqlite3'
# List of plugins
# Supports `github_username/repo` or full git URLs
set -g @tpm_plugins " \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
"
# plugin that saves session
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-resurrect \
'
# Other examples:
# github_username/plugin_name \
# git@github.com/user/plugin \
# git@bitbucket.com/user/plugin \
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell ~/.tmux/plugins/tpm/tpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment