dotfiles/misc/tmux/tmux.conf

86 lines
2.3 KiB
Plaintext
Raw Normal View History

2011-12-30 10:10:35 +11:00
# Unbind unused default keys
unbind '#' # list-buffers
unbind = # choose-buffer
unbind - # delete-buffer
unbind % # split-pane -v
unbind '"' # split-pane -h
unbind q # display-panes
2011-11-08 06:29:17 +11:00
setw -g mode-keys vi
set -g default-terminal "screen-256color"
bind R source-file ~/.tmux.conf
2020-10-24 18:41:18 +11:00
bind '\' confirm-before kill-server
2011-11-08 06:29:17 +11:00
2011-12-30 10:10:35 +11:00
# Mouse
set -g mouse
2011-11-08 06:29:17 +11:00
2011-12-30 10:10:35 +11:00
# Copy/Pasting
bind [ copy-mode
bind ] paste-buffer -s \015
2011-11-08 06:29:17 +11:00
2011-12-30 10:10:35 +11:00
bind b list-buffers # list all paste buffers (default key is '#')
bind p choose-buffer # choose buffer to paste interactively (default key was '=')
bind x delete-buffer # delete the most recently copied buffer of text (default key was '-')
2011-11-08 06:29:17 +11:00
# new window
2011-12-30 10:10:35 +11:00
bind C-c new-window
bind c new-window
# Window/Pane management
# Options
set -g base-index 1
set -g set-titles on
setw -g automatic-rename on
# Splitting
bind _ split-window -v
bind | split-window -h
# Resizing
bind -r < resize-pane -L 3
bind -r > resize-pane -R 3
bind -r + resize-pane -U 1
bind -r - resize-pane -D 1
# Swapping panes
bind -r J swap-pane -D
bind -r K swap-pane -U
# Jumping to panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind b last-window # Jump to last active window
bind w display-panes # display visible indicator of each pane
2011-11-08 06:29:17 +11:00
# Statusbar settings
2011-12-30 10:10:35 +11:00
set -g status-keys vi
set -g display-time 4000 # How long messages are displayed for
2014-04-02 12:22:28 +11:00
setw -g aggressive-resize on
# https://github.com/sjl/vitality.vim/issues/8#issuecomment-7664649
set-option -g terminal-overrides '*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007'
2012-08-28 04:30:01 +10:00
set -sg escape-time 0 # needed to distinguish between ESC and Meta in emacs
2020-10-24 18:58:49 +11:00
if-shell "uname | grep -q Darwin" {
if-shell "command -v reattach-to-user-namespace &>/dev/null" {
set-option -g default-command "reattach-to-user-namespace -l zsh"
} {
set-option -g default-command "zsh"
}
bind C-c run "tmux save-buffer - | pbcopy"
bind C-v run "pbpaste | tmux load-buffer - && tmux paste-buffer"
}
if-shell "uname | grep -q Linux" {
if-shell "command -v zsh &>/dev/null" {
set-option -g default-command "zsh"
} {
set-option -g default-command "bash"
}
}