2013-03-20 17:56:10 -07:00
|
|
|
## Behavior ###############
|
2013-03-17 19:23:39 -07:00
|
|
|
# Zero-based indexing is fine in programming languages, but not so much in
|
|
|
|
# a multiplexer when zero is on the other side of the keyboard.
|
|
|
|
set -g base-index 1
|
2013-03-20 17:56:10 -07:00
|
|
|
set -g renumber-windows on
|
|
|
|
setw -g automatic-rename on
|
2015-10-25 21:41:24 -07:00
|
|
|
# status bar
|
|
|
|
set-option -g status-utf8 on
|
2013-03-17 19:23:39 -07:00
|
|
|
# Remove the <C-a> delay
|
|
|
|
set -s escape-time 0
|
2014-08-12 22:19:03 -07:00
|
|
|
# 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
|
2013-03-20 17:56:10 -07:00
|
|
|
# client connected to *that window*. Much more reasonable.
|
2014-04-11 02:54:46 -07:00
|
|
|
setw -g aggressive-resize off
|
2013-03-20 17:56:10 -07:00
|
|
|
# go zsh, go
|
2015-10-25 21:41:24 -07:00
|
|
|
set-option -g default-shell $SHELL
|
2013-03-21 07:52:15 -07:00
|
|
|
# a mouse
|
2015-10-28 14:22:28 -07:00
|
|
|
setw -g mouse-utf8 on
|
|
|
|
setw -g mouse on
|
2013-03-20 17:56:10 -07:00
|
|
|
|
|
|
|
## Key bindings ###########
|
|
|
|
# Remap the key prefix
|
2014-10-09 15:31:22 -07:00
|
|
|
set -g prefix C-c
|
2013-11-22 20:24:16 -08:00
|
|
|
unbind C-b
|
2014-10-09 15:31:22 -07:00
|
|
|
# Restore sigterm C-c
|
|
|
|
bind C-c send-prefix
|
2013-03-20 17:56:10 -07:00
|
|
|
# Go to last active window
|
2014-08-12 22:19:03 -07:00
|
|
|
bind-key a last-window
|
2013-03-20 17:56:10 -07:00
|
|
|
# reload config without killing server
|
2014-08-12 22:19:03 -07:00
|
|
|
bind r source-file ~/.tmux.conf \; display-message " Config reloaded..".
|
2013-03-20 17:56:10 -07:00
|
|
|
# set vi keys
|
|
|
|
setw -g mode-keys vi
|
|
|
|
unbind [
|
|
|
|
bind Escape copy-mode
|
|
|
|
unbind p
|
|
|
|
bind p paste-buffer
|
|
|
|
bind-key -t vi-copy 'v' begin-selection
|
2013-11-22 20:24:16 -08:00
|
|
|
bind-key -t vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy"
|
|
|
|
|
|
|
|
unbind -t vi-copy Enter
|
|
|
|
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
|
|
|
|
|
2014-08-12 22:19:03 -07:00
|
|
|
## Pane management #####
|
|
|
|
# Better splitting keybinds
|
|
|
|
unbind %
|
|
|
|
unbind '"'
|
2014-08-12 23:46:29 -07:00
|
|
|
bind s split-window -v
|
|
|
|
bind v split-window -h
|
2014-08-12 22:19:03 -07:00
|
|
|
|
2015-11-17 21:58:42 -08:00
|
|
|
# Smart pane switching with awareness of vim splits
|
|
|
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
|
|
|
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
|
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
|
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
|
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
|
|
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
2014-08-12 22:19:03 -07:00
|
|
|
|
2014-12-13 16:35:07 -08:00
|
|
|
bind H resize-pane -L 5
|
|
|
|
bind J resize-pane -D 5
|
|
|
|
bind K resize-pane -U 5
|
|
|
|
bind L resize-pane -R 5
|
|
|
|
|
2014-09-21 07:10:23 -07:00
|
|
|
bind n next-window
|
|
|
|
bind p previous-window
|
|
|
|
|
|
|
|
# Disable confirmation
|
|
|
|
bind & kill-window
|
|
|
|
bind x kill-pane
|
|
|
|
|
2013-03-20 17:56:10 -07:00
|
|
|
# after copying to a tmux buffer, hit y again to copy to clipboard
|
|
|
|
bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
|
|
|
|
# quick view of processes
|
|
|
|
bind '~' split-window "exec top"
|
|
|
|
|
|
|
|
## Looks ########################
|
2014-08-12 22:19:03 -07:00
|
|
|
set -g default-terminal "screen-256color"
|
2015-10-25 21:41:47 -07:00
|
|
|
|
|
|
|
set -g status-bg colour235
|
|
|
|
set -g status-fg white
|
|
|
|
|
|
|
|
set-window-option -g window-status-current-fg black
|
|
|
|
set-window-option -g window-status-current-bg yellow
|
|
|
|
|
|
|
|
set -g pane-border-fg colour235
|
|
|
|
set -g pane-border-bg black
|
|
|
|
set -g pane-active-border-fg yellow
|
|
|
|
set -g pane-active-border-bg black
|
2013-03-17 19:23:39 -07:00
|
|
|
|
2013-03-20 17:56:10 -07:00
|
|
|
## Status bar ###################
|
2014-08-12 22:19:03 -07:00
|
|
|
set-option -g status-justify left
|
2013-11-22 20:24:16 -08:00
|
|
|
set-option -g status-right-length 60
|
|
|
|
set-option -g status-left-length 60
|
2015-10-25 21:41:47 -07:00
|
|
|
set-option -g status-left '#[bg=yellow] #[fg=black]#[bold]#S #[default] '
|
|
|
|
set-option -g status-right '#(hostname) '
|
|
|
|
|
|
|
|
set -g window-status-format "#I. #W"
|
|
|
|
set -g window-status-current-format " #I. #W "
|