Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
116 lines (85 sloc) 3.05 KB
TMUX_HOME=$HOME/dotfiles/tmux
# Use ^A rather than ^B as prefix key
unbind-key C-b
set-option -g prefix C-a
# send ^A to the client (e.g. emacs start-of-line)
bind-key a send-prefix
set -g default-terminal "screen-256color"
set -g default-shell $SHELL
# SESSION OPTIONS
# Set the base index from which an unused index should be searched when a new
# window is created.
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Ignore window bells
set-option -g bell-action none
set-option -g activity-action none
set-option -g silence-action none
# disable visual bell
set -g visual-bell off
# Scrollback buffer n lines
set-option -g history-limit 100000
# A message is shown on a bell instead of it being passed through to the terminal
set-option -g visual-bell on
set-option -g mouse on
# Resize the window to the size of the smallest session for which it is the
# current window, rather than the smallest session to which it is attached.
set-window-option -g aggressive-resize on
# Use vi or emacs-style key bindings in copy and choice modes.
set-window-option -g mode-keys vi
# Use vi key bindings in the status line
set-option -g status-keys vi
# Display a status line message when activity occurs in a window for which the
# monitor-activity window option is enabled.
set-option -g visual-activity on
# Windows with activity are highlighted in the status line.
set-window-option -g monitor-activity on
unbind-key %
bind-key | split-window -h
bind-key - split-window -v
# quick pane cycling
unbind-key C-a
bind-key C-a select-pane -t :.+
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# switch windows ... although maybe I want C-l to redraw the screen
bind-key C-h previous-window
bind-key C-l next-window
# act like vim. enhance copy mode to use more vim like keys for copying
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection-and-cancel
bind-key p paste-buffer
#######################
# GENERAL KEYBINDINGS #
#######################
# ^C to create a new window
bind-key C-c new-window
# ^D to detach
bind-key C-d detach-client
# ^R to force a reload of the config file
bind-key C-r source-file ~/.tmux.conf\; display-message "source-file done"
# ^S to switch sessions
bind-key C-s choose-session
# Don't prompt ... show some balls
bind-key C-x kill-pane
# toggle synchronized panes
bind-key S set -w synchronize-panes
# Kill the session
bind-key X kill-session
# ALT-n to switch window.
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10
# apply theme
if-shell "test -f $tmux_theme" "source $TMUX_HOME/theme"
if-shell 'test "$(uname)" = "Darwin"' 'source $TMUX_HOME/tmux-osx.conf'